From: Bernard Blackham Date: Sun, 3 Aug 2003 16:19:56 +0000 (+0000) Subject: have big division figured out X-Git-Tag: ROMW~116 X-Git-Url: https://git.ucc.asn.au/?p=uccvend-snackrom.git;a=commitdiff_plain;h=a3a7f30a9b201ef620462d40af092e6cb6ffbc9e have big division figured out --- diff --git a/ROM-2003/vend.asm b/ROM-2003/vend.asm index 38c7145..576324f 100644 --- a/ROM-2003/vend.asm +++ b/ROM-2003/vend.asm @@ -3992,7 +3992,7 @@ A255 CC AF A5 ... ldd #afa5 ; "CLR MIS N" A258 BD C0 BA ... jsr c0ba ;display: A25B 39 9 rts -jump82: +bigmodulus: A25C 37 7 pshb A25D 36 6 psha A25E F6 00 2C .., ldab 002c @@ -4071,11 +4071,11 @@ A304 26 05 &. bne 05 ; to a30b A306 C6 24 .$ ldab #24 ; "$" A308 F7 0B 95 ... stab 0b95 A30B CC 00 01 ... ldd #0001 -A30E BD A2 5C ..\ jsr a25c ;jump82 +A30E BD A2 5C ..\ jsr a25c ;bigmodulus A311 20 05 . bra 05 ; return A313 5F _ clrb A314 4F O clra -A315 BD A2 5C ..\ jsr a25c ;jump82 +A315 BD A2 5C ..\ jsr a25c ;bigmodulus A318 38 8 pulx A319 39 9 rts @@ -4111,7 +4111,7 @@ A346 EC 04 .. ldd 04,x A348 37 7 pshb A349 36 6 psha A34A EC 02 .. ldd 02,x -A34C BD E6 21 ..! jsr e621 ;jump56 +A34C BD E6 21 ..! jsr e621 ;jump56 - write to display A34F 38 8 pulx A350 C6 20 . ldab #20 ; " " A352 F7 0B 99 ... stab 0b99 @@ -4121,7 +4121,7 @@ A35A 26 05 &. bne 05 A35C C6 24 .$ ldab #24 ; "$" A35E F7 0B 98 ... stab 0b98 A361 CC 00 01 ... ldd #0001 -A364 BD A2 5C ..\ jsr a25c ;jump82 +A364 BD A2 5C ..\ jsr a25c ;bigmodulus A367 38 8 pulx A368 31 1 ins A369 31 1 ins @@ -8355,7 +8355,7 @@ C0B8 38 8 pulx C0B9 39 9 rts ;Display a string. D points to the string, which is NULL-terminated - +; display: C0BA 37 7 pshb C0BB 36 6 psha @@ -13009,7 +13009,7 @@ E630 36 6 psha E631 CE 96 80 ... ldx #9680 ;38528 E634 3C < pshx E635 CC 00 98 ... ldd #0098 ;152 -E638 BD FC 4C ..L jsr fc4c ;jump83 +E638 BD FC 4C ..L jsr fc4c ;bigdivide E63B 31 1 ins E63C 33 3 pulb E63D CB 30 .0 addb #30 ; make it a digit @@ -13025,13 +13025,13 @@ E64A 36 6 psha E64B CE 96 80 ... ldx #9680 ;38528 E64E 3C < pshx E64F CC 00 98 ... ldd #0098 ;152 -E652 BD FC 5C ..\ jsr fc5c ;jump82 +E652 BD FC 5C ..\ jsr fc5c ;bigmodulus E655 37 7 pshb E656 36 6 psha E657 CE 42 40 .B@ ldx #4240 ;16960 E65A 3C < pshx E65B CC 00 0F ... ldd #000f ;15 -E65E BD FC 4C ..L jsr fc4c ;jump83 +E65E BD FC 4C ..L jsr fc4c ;bigdivide E661 31 1 ins E662 33 3 pulb E663 CB 30 .0 addb #30 @@ -13047,13 +13047,13 @@ E670 36 6 psha E671 CE 42 40 .B@ ldx #4240 ;16960 E674 3C < pshx E675 CC 00 0F ... ldd #000f ;15 -E678 BD FC 5C ..\ jsr fc5c ;jump82 +E678 BD FC 5C ..\ jsr fc5c ;bigmodulus E67B 37 7 pshb E67C 36 6 psha E67D CE 86 A0 ... ldx #86a0 ;34464 E680 3C < pshx E681 CC 00 01 ... ldd #0001 ;1 -E684 BD FC 4C ..L jsr fc4c ;jump83 +E684 BD FC 4C ..L jsr fc4c ;bigdivide E687 31 1 ins E688 33 3 pulb E689 CB 30 .0 addb #30 @@ -13069,13 +13069,13 @@ E696 36 6 psha E697 CE 86 A0 ... ldx #86a0 ;34464 E69A 3C < pshx E69B CC 00 01 ... ldd #0001 ;1 -E69E BD FC 5C ..\ jsr fc5c ;jump82 +E69E BD FC 5C ..\ jsr fc5c ;bigmodulus E6A1 37 7 pshb E6A2 36 6 psha E6A3 CE 27 10 .'. ldx #2710 ;10000 E6A6 3C < pshx E6A7 CC 00 00 ... ldd #0000 -E6AA BD FC 4C ..L jsr fc4c ;jump83 +E6AA BD FC 4C ..L jsr fc4c ;bigdivide E6AD 31 1 ins E6AE 33 3 pulb E6AF CB 30 .0 addb #30 @@ -13091,13 +13091,13 @@ E6BC 36 6 psha E6BD CE 27 10 .'. ldx #2710 ;10000 E6C0 3C < pshx E6C1 CC 00 00 ... ldd #0000 -E6C4 BD FC 5C ..\ jsr fc5c ;jump82 +E6C4 BD FC 5C ..\ jsr fc5c ;bigmodulus E6C7 37 7 pshb E6C8 36 6 psha E6C9 CE 03 E8 ... ldx #03e8 ;1000 E6CC 3C < pshx E6CD CC 00 00 ... ldd #0000 -E6D0 BD FC 4C ..L jsr fc4c ;jump83 +E6D0 BD FC 4C ..L jsr fc4c ;bigdivide E6D3 31 1 ins E6D4 33 3 pulb E6D5 CB 30 .0 addb #30 @@ -13114,13 +13114,13 @@ E6E2 36 6 psha E6E3 CE 03 E8 ... ldx #03e8 ;1000 E6E6 3C < pshx E6E7 CC 00 00 ... ldd #0000 -E6EA BD FC 5C ..\ jsr fc5c ;jump82 +E6EA BD FC 5C ..\ jsr fc5c ;bigmodulus E6ED 37 7 pshb E6EE 36 6 psha E6EF CE 00 64 ..d ldx #0064 ;100 E6F2 3C < pshx E6F3 CC 00 00 ... ldd #0000 -E6F6 BD FC 4C ..L jsr fc4c ;jump83 +E6F6 BD FC 4C ..L jsr fc4c ;bigdivide E6F9 31 1 ins E6FA 33 3 pulb E6FB CB 30 .0 addb #30 @@ -13136,13 +13136,13 @@ E708 36 6 psha E709 CE 00 64 ..d ldx #0064 ;100 E70C 3C < pshx E70D CC 00 00 ... ldd #0000 -E710 BD FC 5C ..\ jsr fc5c ;jump82 +E710 BD FC 5C ..\ jsr fc5c ;bigmodulus E713 37 7 pshb E714 36 6 psha E715 CE 00 0A ... ldx #000a ;10 E718 3C < pshx E719 CC 00 00 ... ldd #0000 -E71C BD FC 4C ..L jsr fc4c ;jump83 +E71C BD FC 4C ..L jsr fc4c ;bigdivide E71F 31 1 ins E720 33 3 pulb E721 CB 30 .0 addb #30 @@ -13158,7 +13158,7 @@ E72E 36 6 psha E72F CE 00 0A ... ldx #000a ;10 E732 3C < pshx E733 CC 00 00 ... ldd #0000 -E736 BD FC 5C ..\ jsr fc5c ;jump82 +E736 BD FC 5C ..\ jsr fc5c ;bigmodulus E739 31 1 ins E73A 33 3 pulb E73B CB 30 .0 addb #30 @@ -14648,7 +14648,7 @@ F341 EC 04 .. ldd 04,x F343 37 7 pshb F344 36 6 psha F345 EC 02 .. ldd 02,x -F347 BD E6 21 ..! jsr e621 ;jump56 +F347 BD E6 21 ..! jsr e621 ;jump56 - write to display F34A 38 8 pulx F34B C6 07 .. ldab #07 F34D F7 00 18 ... stab 0018 @@ -15680,15 +15680,14 @@ FC4B 39 9 rts -; jump83: and jump82: are the same function, but jump82 seeds a local +; bigdivide: and bigmodulus: are a division function and a remainder function +; for stupidly huge numbers. +; ; ; the number in D is prepended to the number at the top of the stack ; eg, 0x0f in D and 0x4240 on stack => 0x0f4240 = 1000000 ; -; could it be a 16-bit division function??? -; (observing where its called from in jump56) -; -jump83: +bigdivide: FC4C 3C < pshx FC4D 3C < pshx FC4E 37 7 pshb @@ -15702,7 +15701,7 @@ FC56 4F O clra FC57 A7 04 .. staa 04,x FC59 7E FC 6D ~.m jmp fc6d ;goto88 -jump82: +bigmodulus: FC5C 3C < pshx FC5D 3C < pshx FC5E 37 7 pshb