URL
https://opencores.org/ocsvn/tv80/tv80/trunk
Subversion Repositories tv80
[/] [tv80/] [branches/] [restruc2/] [tests/] [otir.asm] - Rev 108
Go to most recent revision | Compare with Previous | Blame | View Log
; basic test of OTIR block-transfer instruction;; initializes a memory region and then transfers that region; to an accumulator.module otir;--------------------------------------------------------; special function registers;--------------------------------------------------------_sim_ctl_port = 0x0080_msg_port = 0x0081_timeout_port = 0x0082_max_timeout_low = 0x0083_max_timeout_high = 0x0084_intr_cntdwn = 0x0090_cksum_value = 0x0091_cksum_accum = 0x0092_inc_on_read = 0x0093.area INIT (ABS).org 0jp initinit:ld sp, #0xffff;; initialize dbuf memory area with regular pattern;; pattern starts with 1 and incrementsld hl, #dbufld b, #255ld c, #1dbuf_init:ld (hl), cinc hlinc cdjnz dbuf_initcall reset_timeoutld b, #16call xfer_testcall reset_timeoutld b, #63call xfer_testcall reset_timeoutld b, #127call xfer_testcall reset_timeoutld b, #128call xfer_testcall reset_timeoutld b, #254call xfer_testcall reset_timeoutld b, #255call xfer_test;; finish simulation with test passedld a, #1out (_sim_ctl_port), aret;; test sending X amount of data from the buffer to the;; accumulator. Amount of data to transfer is in B.;; After tranferring data to checksummer, perform;; checksum and comparexfer_test:push bcld hl, #dbufld a, #0out (_cksum_value), ald c, #_cksum_accumotir;; do checksum over same regionpop bcld hl, #dbufld a, #0xfer_test_cksum:add a, (hl)inc hldjnz xfer_test_cksum;; store calc'ed checksum in D and read out cksum registerld d, ain a, (_cksum_value);; compare two values and fail test if not equalcp djp nz, xfer_failretxfer_fail:ld a, #2out (_sim_ctl_port), aretreset_timeout:ld a, #2out (_timeout_port), aret.org 0x8000dbuf:.ds 256
Go to most recent revision | Compare with Previous | Blame | View Log
