est un simulateur de microcontrôleurs, dont notre msp430
Michael Kohn
work@Toshiba:~/Softs/naken_asm-2020-01-20/samples/msp430$ naken_util
naken_util - by Michael Kohn
Joe Davisson
Web: http://www.mikekohn.net/
Email: mike@mikekohn.net
Version: January 20, 2020
Usage: naken_util [options] <infile>
// ELF files can auto-pick a CPU, if a hex file use:
-1802 (RCA 1802)
-4004 (Intel 4004)
-6502 (6502)
-65816 (65816)
-6800 (6800)
-6809 (6809)
-68hc08 (68hc08)
-68000 (68000)
-8048 (8048 / MCS-48)
-8051 / -8052 (8051 / 8052 / MCS-51)
-arc (ARC)
-arm (ARM)
-avr8 (Atmel AVR8)
-cell (IBM Cell BE)
-copper (Amiga Copper)
-cp1610 (General Instruments CP1610)
-dotnet (.NET CIL)
-dspic (dsPIC)
-epiphany (Epiphany III/IV)
-java (Java)
-lc3 (LC-3)
-m8c (PSoC M8C)
-mips32 / mips (MIPS)
-msp430 (MSP430/MSP430X) DEFAULT
-pdp8 (PDP-8)
-pic14 (PIC14 8 bit PIC / 14 bit opcode)
-powerpc (PowerPC)
-propeller (Parallax Propeller)
-ps2ee (Playstation 2 EE)
-ps2ee_vu0 (Playstation 2 VU0)
-ps2ee_vu1 (Playstation 2 VU1)
-riscv (RISCV)
-sh4 (SH4)
-stm8 (STM8)
-super_fx (SuperFX)
-sweet16 (sweet16)
-tms1000 (TMS1000)
-tms1100 (TMS1100)
-tms9900 (TMS9900)
-webasm (WebAssembly)
-xtensa (Xtensa)
-z80 (z80)
-bin (file is binary)
// The following options turn off interactive mode
-disasm (Disassemble all or part of program)
-run (Simulate program and dump registers)
-address <start_address> (For bin files: binary placed at this address)
-set_pc <address> (Sets program counter after loading program)
-break_io <address> (In -run mode writing to an i/o port exits sim)
Nous avons obtenu un code launch.hex avec naken_asm
naken_util -msp430 launch.hex
ici nous allons utiliser le msp430 (par défaut si on ne le précise pas)
work@Toshiba:~/Softs/naken_asm-2020-01-20/samples/msp430$ naken_util -msp430 launch.hex
naken_util - by Michael Kohn
Joe Davisson
Web: http://www.mikekohn.net/
Email: mike@mikekohn.net
Version: January 20, 2020
Loaded hexfile launch.hex from 0xf800 to 0xffff
Type help for a list of commands.
stopped>
stopped> reset
stopped> registers
Simulation Register Dump Stack
-------------------------------------------------------------------
8 7 6 4 3 2 1 0 0x0800: 0x0000
Status: V SCG1 SCG0 OSCOFF CPUOFF GIE N Z C 0x0802: 0x0000
0 0 0 0 0 0 0 0 0 0x0804: 0x0000
0x0806: 0x0000
PC: 0xf800, SP: 0x0800, SR: 0x0000, CG: 0x0000, 0x0808: 0x0000
r4: 0x0000, r5: 0x0000, r6: 0x0000, r7: 0x0000, 0x080a: 0x0000
r8: 0x0000, r9: 0x0000, r10: 0x0000, r11: 0x0000, 0x080c: 0x0000
r12: 0x0000, r13: 0x0000, r14: 0x0000, r15: 0x0000, 0x080e: 0x0000
0 clock cycles have passed since last reset.
stopped> step
avancer d'un pas
Simulation Register Dump Stack
-------------------------------------------------------------------
8 7 6 4 3 2 1 0 0x0800: 0x0000
Status: V SCG1 SCG0 OSCOFF CPUOFF GIE N Z C 0x0802: 0x0000
0 0 0 0 0 0 0 0 0 0x0804: 0x0000
0x0806: 0x0000
PC: 0xf806, SP: 0x0800, SR: 0x0000, CG: 0x0000, 0x0808: 0x0000
r4: 0x0000, r5: 0x0000, r6: 0x0000, r7: 0x0000, 0x080a: 0x0000
r8: 0x0000, r9: 0x0000, r10: 0x0000, r11: 0x0000, 0x080c: 0x0000
r12: 0x0000, r13: 0x0000, r14: 0x0000, r15: 0x0000, 0x080e: 0x0000
5 clock cycles have passed since last reset.
! 0xf800: 0x40b2 mov.w #0x5a80, &0x0120 5
0xf802: 0x5a80
0xf804: 0x0120
> 0xf806: 0x40f2 mov.b #0x41, &0x0022 5
0xf808: 0x0041
0xf80a: 0x0022
stopped>
continuer à avancer de pas en pas et voir comment se comporte notre programme
on peut modifier les registrer
stopped> set r9=0x0003
Register r9 set to 0x0003.
run va lancer notre programme au ralenti (speed en hz) et une animation va nous montrer ce qu'il se passe dans une bête comme le msp430