hello1.asm

(1/1)

Richard Marks:
hello1.asm

Code:

; hello1.asm
; coded by Richard Marks for the ECPU virtual computer emulator v0.0.1
inc 0x0A
print ; newline
inc 0x3E
print ; H
inc 0x1D
print ; e
inc 0x07
print ; l
print ; l
inc 0x03
print ; o
dec 0x4F
print ; (space)
inc 0x37
print ; W
inc 0x18
print ; o
inc 0x03
print ; r
dec 0x06
print ; l
dec 0x08
print ; d
dec 0x5A
print ; newline
end


Save that as a text file named hello1.asm and then run it through the assembler:
Code:

$ ./ecpu-assembler hello1.asm
ECPU Virtual Microcomputer Emulation Device Program Assembler v0.0.5 AR2-031009

(C) Copyright 2009, Richard Marks, CCPS Solutions, Undefined Aeon Software.
www.ccpssolutions.com - www.uasoft.info

Assembling.Assembling:#0x00000001: inc 0x0A
.Assembling:#0x00000002: print ; newline
.Assembling:#0x00000003: inc 0x3E
.Assembling:#0x00000004: print ; H
.Assembling:#0x00000005: inc 0x1D
.Assembling:#0x00000006: print ; e
.Assembling:#0x00000007: inc 0x07
.Assembling:#0x00000008: print ; l
.Assembling:#0x00000009: print ; l
.Assembling:#0x0000000A: inc 0x03
.Assembling:#0x0000000B: print ; o
.Assembling:#0x0000000C: dec 0x4F
.Assembling:#0x0000000D: print ; (space)
.Assembling:#0x0000000E: inc 0x37
.Assembling:#0x0000000F: print ; W
.Assembling:#0x00000010: inc 0x18
.Assembling:#0x00000011: print ; o
.Assembling:#0x00000012: inc 0x03
.Assembling:#0x00000013: print ; r
.Assembling:#0x00000014: dec 0x06
.Assembling:#0x00000015: print ; l
.Assembling:#0x00000016: dec 0x08
.Assembling:#0x00000017: print ; d
.Assembling:#0x00000018: dec 0x5A
.Assembling:#0x00000019: print ; newline
.Assembling:#0x0000001A: end
.Finished.
Assembled 26 lines into 26 instructions and 38 bytes


Run the assembled binary through the emulator:
Code:

$ ./ecpu-emulator hello1.bin
ECPU Virtual Microcomputer Emulation Device v0.0.5 AR2-031009

(C) Copyright 2009, Richard Marks, CCPS Solutions, Undefined Aeon Software.
www.ccpssolutions.com - www.uasoft.info


Hello World

Navigation

[0] Message Index