Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;ports
- #define PORT_ADD_LOW 02h
- #define PORT_ADD_HIGH 03h
- #define PORT_COMMAND 04h
- #define PORT_TIMER_FREQ_LOW 05h
- #define PORT_TIMER_FREQ_HIGH 06h
- ;for commands for PORT_COMMAND
- #define COMMAND_WRITE_SERIEL 01h
- #define COMMAND_ENABLE_TIMER 02h
- #define COMMAND_DISABLE_TIMER 03h
- #define COMMAND_NMI_ACK 04h
- #define INTURUPT_CAUESE_ADDRESS 77 ;temp
- #define INTURUPT_CAUES_TIMER 0x01
- #define output(x, y) ld a,y \ out (x),a
- #define command(x) output(PORT_COMMAND, x)
- .org 0
- ld sp,stack
- im 1
- ei
- output(PORT_ADD_LOW, testfoo & FFh)
- output(PORT_ADD_HIGH, testfoo >> 8)
- command(COMMAND_WRITE_SERIEL)
- output(PORT_ADD_LOW, output & FFh)
- output(PORT_ADD_HIGH, output >> 8)
- output(PORT_TIMER_FREQ_LOW, 88h)
- output(PORT_TIMER_FREQ_HIGH, 10h)
- command(COMMAND_ENABLE_TIMER)
- jr $
- ;leave a bit of space for SP
- .db 0,0
- .db 0,0
- .db 0,0
- .db 0,0
- stack:
- .db 0,0
- .align 0038h
- inturupt:
- .if $ != 0038h
- .fail "& should be 38h"
- .endif
- di
- command(COMMAND_NMI_ACK)
- command(COMMAND_WRITE_SERIEL)
- ei
- ret
- output:
- .db "int",0
- testfoo:
- .db "test",0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement