|
File: buffer.t2
For general comments see here
Line | Address | Object Code
| Label | F1 | N1 | B | F2 | N2 | Comments | Check
|
---|
1 | 0 | | ; tape2/buffer.t2 |
| 2 | 0 | | ;---------------- |
| 3 | 0 | | ; advance, buffer |
| 4 | 0 | | ; |
| 5 | 0 | | Advance:: | ; | |
| 6 | 0 | | ; |
| 7 | 0 | | ; scratch data areas used locally |
| 8 | 0 | | ; |
| 9 | 0 | | =7241 | |
| 10 | 7241 | 0000000000000 | .shift: | +0 | ; 0/32 based on current character shift |
| 11 | 7242 | | .currchar: | ; | |
| 12 | 7242 | 0000000000000 | | +0 | ; save for current character |
| 13 | 7243 | | =7252 | |
| 14 | 7252 | | .rdrnum: | ; | |
| 15 | 7252 | 0000000000000 | | +0 | ; reader number (arg1*2**11) |
| 16 | 7253 | | =7684 | |
| 17 | 7684 | | ; |
| 18 | 7684 | | ; advance(d) |
| 19 | 7684 | | ; |
| 20 | 7684 | | Advance: | ; | |
| 21 | 7684 | 0600016 | | lod | arg1 | | | | ;check arg1 for limits | @7684
| 22 | 7684+ | 0116210 | | add | N1 | | | | ;=-1 |
| 23 | 7685 | 1137006 | | jn | .A1 | | | | ; | @7685
| 24 | 7685+ | 0136223 | | sub | K4 | | | | ;=4 |
| 25 | 7686 | 1137007 | | jn | .A2 | | | | ; | @7686
| 26 | 7686+ | | .A1: | ; | |
| 27 | 7686+ | 0040000 | | o02 | 0 | | | | ;=1, arg1 out of range - take default |
| 28 | 7687 | 0400016 | | sto | arg1 | | | | ; | @7687
| 29 | 7687+ | | .A2: | ; | |
| 30 | 7687+ | 0600016 | | lod | arg1 | | | | ;shift reader number to hw posn |
| 31 | 7688 | 1320013 | | sll | 11 | | | | ; | @7688
| 32 | 7688+ | 0416124 | | sto | .rdrnum | | | | ;and save for later |
| 33 | 7689 | 0000072600077 | | o00 | arg1 | / | lod | RdBuff-1 | ;load current buffer | @7689
| 34 | 7690 | 0076225 | | and | K32 | | | | ;=32 mask shift | @7690
| 35 | 7690+ | | .A3: | ; | |
| 36 | 7690+ | 0416111 | | sto | .shift | | | | ;save shift |
| 37 | 7691 | | .A4: | ; | |
| 38 | 7691 | 0670523614000 | | cla | .rdrnum | / | inp | -2048 | ;get next character | @7691
| 39 | 7692 | 1057013 | | jz | .A4 | | | | ;ignore blank | @7692
| 40 | 7692+ | 0416112 | | sto | .currchar | | | | ;save current char |
| 41 | 7693 | 0136215 | | sub | K27 | | | | ;=27 check fig shift | @7693
| 42 | 7693+ | 1157012 | | jz | .A3 | | | | ;store zero shift |
| 43 | 7694 | 0136223 | | sub | K4 | | | | ;=4 check letter shift | @7694
| 44 | 7694+ | 1157021 | | jz | .A5 | | | | ;store shift=32 |
| 45 | 7695 | 0616112 | | lod | .currchar | | | | ;reload char | @7695
| 46 | 7695+ | 0116111 | | add | .shift | | | | ;add shift |
| 47 | 7696 | 0000072400077 | | o00 | arg1 | / | sto | RdBuff-1 | ;store in buffer | @7696
| 48 | 7697 | 1016043 | | jmp | RetClr | | | | ;return | @7697
| 49 | 7697+ | | ; |
| 50 | 7697+ | | ; set shift to 32 |
| 51 | 7697+ | | ; |
| 52 | 7697+ | | .A5: | ; | |
| 53 | 7697+ | 0616225 | | lod | K32 | | | | ;=32 |
| 54 | 7698 | 1117012 | | jmp | .A3 | | | | ;store updated shift | @7698
| 55 | 7698+ | | ; |
| 56 | 7698+ | 0000000 | | o00 | 0 | | | | ; |
| 57 | 7699 | | ;-------------------------------------------------------------------- |
| 58 | 7699 | | ; buffer(d, str) |
| 59 | 7699 | | ; |
| 60 | 7699 | | ;Buffer:: |
| 61 | 7699 | | Buffer: | ; | |
| 62 | 7699 | 0600016 | | lod | arg1 | | | | ; | @7699
| 63 | 7699+ | 0116210 | | add | N1 | | | | ;=-1 |
| 64 | 7700 | 1137025 | | jn | .1 | | | | ; | @7700
| 65 | 7700+ | 0136223 | | sub | K4 | | | | ;=4 |
| 66 | 7701 | 1037027 | | jn | .2 | | | | ; | @7701
| 67 | 7701+ | | .1: | ; | |
| 68 | 7701+ | 0040000 | | o02 | 0 | | | | ; |
| 69 | 7702 | 0400016 | | sto | arg1 | | | | ; | @7702
| 70 | 7702+ | 0000000 | | o00 | 0 | | | | ; |
| 71 | 7703 | | .2: | ; | |
| 72 | 7703 | 0000076600000 | | o00 | arg2 | / | lod | 0 | ;load string address | @7703
| 73 | 7704 | 1220036 | | srl | 30 | | | | ;shift down into AR | @7704
| 74 | 7704+ | 0076212 | | and | K63 | | | | ;=63 mask first char |
| 75 | 7705 | 1157042 | | jz | .7 | | | | ;not valid char! | @7705
| 76 | 7705+ | 0416112 | | sto | .currchar | | | | ;store first char |
| 77 | 7706 | 0076225 | | and | K32 | | | | ;mask sign | @7706
| 78 | 7706+ | 0176112 | | bus | .currchar | | | | ;subtract sign from char |
| 79 | 7707 | 0136215 | | sub | K27 | | | | ;=27 figure shift | @7707
| 80 | 7707+ | 1137036 | | jn | .4 | | | | ;ok |
| 81 | 7708 | 0000072600077 | | o00 | arg1 | / | lod | RdBuff-1 | ;load current buffer char | @7708
| 82 | 7709 | 0136112 | | sub | .currchar | | | | ;compare with char | @7709
| 83 | 7709+ | 1320001 | | sll | 1 | | | | ;shift shift bit out |
| 84 | 7710 | 1017040 | | jmp | .5 | | | | ;set return | @7710
| 85 | 7710+ | | ; |
| 86 | 7710+ | | .4: | ; | |
| 87 | 7710+ | 0616112 | | lod | .currchar | | | | ;get char |
| 88 | 7711 | 0000072120077 | | o00 | arg1 | / | sub | RdBuff-1 | ;compare with buffer | @7711
| 89 | 7712 | | .5: | ; | |
| 90 | 7712 | 0076212 | | and | K63 | | | | ;=63 | @7712
| 91 | 7712+ | 1157041 | | jz | .6 | | | | ;if zero, set false |
| 92 | 7713 | 0616227 | | lod | Signbit | | | | ;=04000000000000 set true | @7713
| 93 | 7713+ | | .6: | ; | |
| 94 | 7713+ | 0116227 | | add | Signbit | | | | ;complement value |
| 95 | 7714 | 1016043 | | jmp | RetClr | | | | ;and return it | @7714
| 96 | 7714+ | | ; |
| 97 | 7714+ | | .7: | ; | |
| 98 | 7714+ | 0616577 | | lod | Msg18 | | | | ;'BUFFER ERROR' |
| 99 | 7715 | 1016165 | | jmp | outerror0 | | | | ; | @7715
| 100 | 7715+ | | ; |
| 101 | 7715+ | 0000000 | | o00 | 0 | | | | ; |
| 102 | 7716 | | ;-------------------------------------------------------------------- |
|
|