From c8495413a3e982060a7df769f25365fb5c54caf2 Mon Sep 17 00:00:00 2001 From: Tobias Girstmair Date: Fri, 12 Mar 2021 19:42:27 +0100 Subject: [PATCH] add cycle count and some comments --- bsv.S | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bsv.S b/bsv.S index 27c61b5..84370bd 100644 --- a/bsv.S +++ b/bsv.S @@ -13,6 +13,7 @@ tmp_hi: .ds 1 ; 0x16 tmp_lo: .ds 1 ; 0x17 pwm: .ds 1 ; 0x18 .area SSEG +.even ; SP must be aligned? (sdcc does it) stack: .ds 1 ; aliases for memory locations: @@ -23,12 +24,17 @@ mul1 = tmp_lo mod3hi = tmp_hi mod3lo = tmp_lo +; cycle count (worst-case) +; mod3: 28 +; g: 81 +; sample: 115 + 4*g + 2*mod3 = 495 .area CSEG (CODE,ABS) ;.area HOME ;.area HEADER (ABS) .org 0x0000 + ;TODO: 0x0000 must be NOP for autocalib routine ;TODO: move some init stuff here (space for 15 instr.) GOTO init @@ -160,6 +166,11 @@ g: RET init: + ; AUTO_INIT_SYSCLOCK() -- 4mhz + ; AUTO_CALIBRATE_SYSCLOCK() -- move away w/ goto + ; ??: setup fuses (romlocation 0x3ff) + ; setup SP (&= 0xfe) + ; setup timer2, timer16 CLEAR i0 CLEAR i1 CLEAR i2 -- 2.39.3