Merge pull request #359 from Shark64/master
keep all assembly examples under a/assembly_*.asm
This commit is contained in:
22
a/assembler_6502.asm
Normal file
22
a/assembler_6502.asm
Normal file
@@ -0,0 +1,22 @@
|
||||
; goodbyeworld.s for C= 8-bit machines, ca65 assembler format.
|
||||
; String printing limited to strings of 256 characters or less.
|
||||
|
||||
a_cr = $0d ; Carriage return.
|
||||
bsout = $ffd2 ; KERNAL ROM, output a character to current device.
|
||||
|
||||
.code
|
||||
|
||||
ldx #0 ; Starting index 0 in X register.
|
||||
printnext:
|
||||
lda text,x ; Get character from string.
|
||||
beq done ; If we read a 0 we're done.
|
||||
jsr bsout ; Output character.
|
||||
inx ; Increment index to next character.
|
||||
bne printnext ; Repeat if index doesn't overflow to 0.
|
||||
done:
|
||||
rts ; Return from subroutine.
|
||||
|
||||
.rodata
|
||||
|
||||
text:
|
||||
.byte "Hello world!", a_cr, 0
|
||||
45
a/assembler_DCPU16.asm
Normal file
45
a/assembler_DCPU16.asm
Normal file
@@ -0,0 +1,45 @@
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
jsr init_devices
|
||||
jsr Hello_World
|
||||
set PC,end
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
:dev_screen dat 0
|
||||
:device_count dat 0
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
:find_devices
|
||||
hwn [device_count]
|
||||
set I,0
|
||||
:find_devices_loop
|
||||
hwq i
|
||||
ife A,0xf615
|
||||
set [dev_screen],1
|
||||
add I,1
|
||||
ifn I,device_count
|
||||
set PC,find_devices_loop
|
||||
set PC,pop
|
||||
:init_devices
|
||||
jsr find_devices
|
||||
;set up display
|
||||
set A,0
|
||||
set B,0x8000
|
||||
hwi [dev_screen]
|
||||
set PC,pop
|
||||
|
||||
:Hello_World
|
||||
set [0x8000],0x1048
|
||||
set [0x8001],0x1065
|
||||
set [0x8002],0x106c
|
||||
set [0x8003],0x106c
|
||||
set [0x8004],0x106f
|
||||
set [0x8005],0x102c
|
||||
set [0x8006],0
|
||||
set [0x8007],0x1077
|
||||
set [0x8008],0x106f
|
||||
set [0x8009],0x1072
|
||||
set [0x800a],0x106c
|
||||
set [0x800b],0x1064
|
||||
set [0x800c],0x1021
|
||||
set PC,pop
|
||||
|
||||
:end
|
||||
set PC,end
|
||||
8
a/assembler_ibm360.asm
Normal file
8
a/assembler_ibm360.asm
Normal file
@@ -0,0 +1,8 @@
|
||||
LA 1,MSGAREA Point Register 1 to message area
|
||||
SVC 35 Invoke SVC 35 (Write to Operator)
|
||||
BR 14 Return
|
||||
MSGAREA EQU * Message Area
|
||||
DC AL2(19) Total area length = 19 (Prefix length:4 + Data Length:15)
|
||||
DC XL2'00' 2 bytes binary of zeros
|
||||
DC C'Hello world!' Text to be written to system console
|
||||
END
|
||||
9
a/assembler_mmix.asm
Normal file
9
a/assembler_mmix.asm
Normal file
@@ -0,0 +1,9 @@
|
||||
t IS $255
|
||||
LOC Data_Segment
|
||||
GREG @
|
||||
String BYTE "Hello World",#a,0
|
||||
|
||||
LOC #100
|
||||
Main LDA t,String
|
||||
TRAP 0,Fputs,StdOut
|
||||
TRAP 0,Halt,0
|
||||
20
a/assembler_z80_ti83calculator.asm
Normal file
20
a/assembler_z80_ti83calculator.asm
Normal file
@@ -0,0 +1,20 @@
|
||||
.NOLIST
|
||||
#define EQU .equ
|
||||
#define equ .equ
|
||||
#define END .end
|
||||
#define end .end
|
||||
#include "ti83plus.inc"
|
||||
.LIST
|
||||
.org 9D93h
|
||||
.db $BB,$6D
|
||||
ld a,0
|
||||
ld (CURCOL),a
|
||||
ld (CURROW),a
|
||||
ld hl,text
|
||||
B_CALL(_PutS)
|
||||
B_CALL(_NewLine)
|
||||
ret
|
||||
text:
|
||||
.db "Hello, World",0
|
||||
.end
|
||||
end
|
||||
Reference in New Issue
Block a user