nigeleke / monop

School Monopoly program written in Macro-10 in 1975
MIT License
0 stars 1 forks source link

[qa] Check exit out of closure in dice throw routine #5

Open nigeleke opened 10 months ago

nigeleke commented 10 months ago

Check this code: NORMGO: HRRZ AC2,AC ADD AC2,N CAILE AC2,47 ;PAST GO ? JRST [MOVEI AC1,^D200 ;ADD ON MONEY ADDM AC1,CASH(PLAYER) HRRI AC,-50(AC2) ;CORRECT POSITION JRST .+2] ;EXIT HRR AC,AC2

Where does the JRST actually jump to? What is the '.' (current location) actually referring too? The closure or the base context?

nigeleke commented 10 months ago

Similarly Get out of jail

;GET OUT OF JAIL FREE OUTJAL: MOVE AC,POSN ;CHECK TO SEE IF GET OUT IOR AC,POSN+1 ;CARD'S BEEN PICKED SKIPE CHNCM JRST [TLNE AC,P.CHNJ ;CHANCE CARD? JRST GETCHN+1 ;YES, PICK AGAIN JRST CANPIK] ;NO TLNE AC,P.CMJ ;COMMUNITY CARD? JRST GETCHN+1 ;YES, PICK AGAIN CANPIK: OUTSTR [ASCIZ\GET OUT OF JAIL FREE. ] JUMPN PLAYER,[OUTSTR [ASCIZ\KEEP OR SELL ?] INCHWL C JSR CMPLIN CAIN C,"K" JRST .+1 ;KEEP CAIN C,"S" JRST [MOVEI AC,50 ;SELL FOR $40 ADDM AC,CASH+1 JRST PICKEX+1] OUTSTR [ASCIZ\PLEASE ANSWER ] JRST @.]

nigeleke commented 10 months ago

similarly cailac

CAILAC: HRRZ AC1,POSN(PLAYER) CAIL AC1,AC ;PLAYER PASSES GO? JRST [MOVEI AC1,^D200 ;YES ADDM AC1,CASH(PLAYER) JRST .+1]