diff --git a/common/envfile.c b/common/envfile.c index c8999a2..f416a2e 100755 --- a/common/envfile.c +++ b/common/envfile.c @@ -5,19 +5,25 @@ #include #include + #ifdef HAVE_STRING_H # include #else # include #endif -#ifndef macintosh -# include + +#ifdef __APPLE__ +# include +#else +# ifndef __FreeBSD__ +# include +# endif #endif #include "envfile.h" #ifdef dll -#include "dllfile.h" +# include "dllfile.h" #endif char *nameptr; diff --git a/common/getopt.c b/common/getopt.c index fc7d06d..630f7b2 100755 --- a/common/getopt.c +++ b/common/getopt.c @@ -21,7 +21,7 @@ int optopt, opterr = TRUE, optind = 1; char *optarg; -static int sp = 1; +int sp = 1; int getopt( int argc, char * const argv[], const char *opts ) { diff --git a/doc/MAKEROM.DOC b/doc/MAKEROM.DOC index 3e08ad8..786b800 100755 --- a/doc/MAKEROM.DOC +++ b/doc/MAKEROM.DOC @@ -39,30 +39,6 @@ - - - - - - - - - - - - - -1- - - - - - - - - - - - 1. MAKEROM - Library Generator The RPL development tools RPLCOMP, SASM, and SLOAD may be used to @@ -109,26 +85,6 @@ Routines that are not declared EXTERNAL will be compiled as object pointers. - - - - - - - - - -2- - - - - - - - - - - - Assembly language must be bounded by the CODE...ENDCODE directives in order to be address-independent. No statements like CON(5) (*)+5 are allowed, because they are loaded at a specific address. @@ -166,35 +122,6 @@ used to name internal routines within the library. This is done to help separate one library's routines from another. - - - - - - - - - - - - - - - - - - -3- - - - - - - - - - - - The file extensions are defined as follows: EXTENSION MEANING @@ -246,21 +173,6 @@ SLOAD GE.M SLOAD -H G.M - - - - -4- - - - - - - - - - - - The example contains two words, ACONE and VCONE. The files that are used to build the library object are: @@ -307,26 +219,6 @@ of the romid (after re-compiling and assembling everything, of course). A "make" utility would be useful here. - - - - - - - - - -5- - - - - - - - - - - - The second file in group 1, GEEXTDEC.H, contains the external declarations. @@ -350,49 +242,6 @@ declarations in one file, between-file calls are not at risk from a missing external declaration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -6- - - - - - - - - - - - The source files in group 2 above contain the configuration code, the user words, and the remaining code for the application. Note that each file in group 2 "INCLUDEs" both files in group 1. @@ -430,35 +279,6 @@ ; - - - - - - - - - - - - - - - - - - -7- - - - - - - - - - - - The user words are consolidated into one file, in this case GEUSER.S: @@ -499,32 +319,6 @@ order and avoid re-compiling the "check and dispatch" code if only other parts of the code are being changed. - - - - - - - - - - - - - - - -8- - - - - - - - - - - - The dispatchees of the user words may be in one or more files, to the taste of the developer. In this example, the file GEMAIN.S contains the dispatchees of the user words: @@ -578,19 +372,6 @@ ***************************************************************** - - -9- - - - - - - - - - - - The experienced programmer will note that this use of a subroutine in the file GESUBS.S creates more overhead than is needed - the example is here to emphasize file structures. @@ -644,19 +425,6 @@ [left][REVIEW]. - - -10- - - - - - - - - - - - The Equation Library Card libraries use five letters, followed by a space, colon, and text, and this example follows that pattern: @@ -706,23 +474,6 @@ not created. The messsage "Could not open GECFG.ext" is therefore harmless. - - - - - - -11- - - - - - - - - - - - Running SLOAD with the new loader control file GE.M produces a rompart which is ready to link to the HP 48 internal routines. This last step is accomplished with another loader control file, @@ -772,13 +523,3 @@ that is address- independent will have two addresses after its name in the cross reference: one for the routine's definition (where the NULLNAME is) and one for its entry in the link table. - - - - - - -12- - - - - diff --git a/doc/RPLCOMP.DOC b/doc/RPLCOMP.DOC index a6b533f..a3b1420 100755 --- a/doc/RPLCOMP.DOC +++ b/doc/RPLCOMP.DOC @@ -40,31 +40,6 @@ - - - - - - - - - - - - - - -1- - - - - - - - - - - - 1. RPLCOMP - RPL Compiler Rplcomp is an RPL compiler or, more precisely, a preprocessor. @@ -118,22 +93,6 @@ The following words define objects: - - - - - -2- - - - - - - - - - - - LAM Defines a DOLAM object whose name is specified by . The non-ASCII escape sequences listed under $ below are allowed. @@ -191,22 +150,6 @@ For more information about the MASD syntax, please refer to the MASD manual. - - - - - -3- - - - - - - - - - - - # # @@ -268,21 +211,6 @@ objects will occupy element positions in order. For an ARRY, every object position must have an object; in LNKARRYs, object positions may be left blank by using _ as a placeholder, and by - - - - -4- - - - - - - - - - - - dimensioning the array larger than the object list. Array objects must be object definitions; pointers to objects @@ -331,24 +259,6 @@ :: ...(RPLcode)... ; The word ``::'' generates DOCOL, the word ``;'' generates SEMI. - - - - - - - -5- - - - - - - - - - - - BEGIN ...(RPLcode)... AGAIN BEGIN ...(RPLcode)... UNTIL BEGIN ...(RPLcode)... WHILE ...(RPLcode)... REPEAT @@ -379,42 +289,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -6- - - - - - - - - - - - 1.2 Miscellaneous RPL Operations @@ -471,21 +345,6 @@ specified. tNAME - specifies that an additional hash name belongs to the given label. - - - - -7- - - - - - - - - - - - NULLNAME - no hash entry is provided. These words also allow the rompart generator to produce the @@ -528,18 +387,3 @@ These directives generate TITLE, STITLE, and EJECT commands for the assembler. The text for TITLE and STITLE is comprised of the remainder of the line. - - - - - - - - - - - - - - - -8- diff --git a/doc/SASM.DOC b/doc/SASM.DOC index 6d432fc..fe08bcf 100755 --- a/doc/SASM.DOC +++ b/doc/SASM.DOC @@ -154,7 +154,7 @@ Version 3.0.6 manipulation. Working registers A and C are also used for memory access. The scratch registers R0, R1, R2, R3, and R4 are used to temporarily hold the contents of working - registers. Page 4 + registers. 2.3 Field Selection @@ -1692,7 +1692,7 @@ Version 3.0.6 =GETPTR" by calls to the local version ("GOSUB getptr") below. - getptr GOVLNG =GETPTR Page 34 + getptr GOVLNG =GETPTR 7.2.4 GOSUB/RTN @@ -2047,7 +2047,7 @@ Version 3.0.6 next page has reasonable fields marked (1,9,17,28). The important thing is consistency. -A_Standard_Assembly_Language_Header + 7.5.2 A_Standard_Assembly_Language_Header Some version of this header is in use by all of the software people generating Saturn Assembly Language Code. There is @@ -2132,9 +2132,11 @@ A_Standard_Assembly_Language_Header HISTORY: Indicate date, programmers initials, and reason for changes. Don't start really using - this until you feel the code is stable. 7.5.3 Some_Header_Examples + this until you feel the code is stable. + 7.5.3 Some_Header_Examples + ***************************************************************** ***************************************************************** ** Name(S): PKDATE - Pack Date Components (YYYYMMDD order) @@ -2232,7 +2234,7 @@ A_Standard_Assembly_Language_Header - Page 46 EJECT + EJECT ***************************************************************** ***************************************************************** ** @@ -2279,11 +2281,15 @@ A_Standard_Assembly_Language_Header GOTO push%lp ***************************************************************** + + 8. Mnemonic Dictionary + This section contains a description of each Saturn assembler instruction or pseudo-op. The description shows the binary opcode generated by the mnemonic, if any, as well as the execution cycle time required if the mnemonic is an executable instruction. + ?A#0 fs - Test for A not equal to 0 --------- fs = A opcode: 8ACyy @@ -2297,6 +2303,7 @@ A_Standard_Assembly_Language_Header Test whether the fs field of A is not equal to 0. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?A#B fs - Test for A not equal to B --------- fs = A opcode: 8A4yy @@ -2311,8 +2318,6 @@ A_Standard_Assembly_Language_Header of B. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. - - ?A#C fs - Test for A not equal to C --------- fs = A opcode: 8A6yy @@ -2326,6 +2331,7 @@ A_Standard_Assembly_Language_Header Test whether the fs field of A is not equal to the fs field of C. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?A<=B fs - Test for A less than or equal to B --------- fs = A opcode: 8BCyy @@ -2340,6 +2346,7 @@ A_Standard_Assembly_Language_Header fs field of B. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?A=B fs - Test for A greater than or equal to B --------- fs = A opcode: 8B8yy @@ -2409,6 +2417,7 @@ A_Standard_Assembly_Language_Header the fs field of B. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?A>B fs - Test for A greater than B --------- fs = A opcode: 8B0yy @@ -2422,6 +2431,7 @@ A_Standard_Assembly_Language_Header Test whether the fs field of A is greater than the fs field of B. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?B#0 fs - Test for B not equal to 0 --------- fs = A opcode: 8ADyy @@ -2436,7 +2446,7 @@ A_Standard_Assembly_Language_Header followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. - ?B#A fs - Test for B not equal to A + ?B#A fs - Test for B not equal to A --------- fs = A opcode: 8A4yy cycles: 13 + d (GO/RTNYES) @@ -2449,6 +2459,7 @@ A_Standard_Assembly_Language_Header Test whether the fs field of B is not equal to the fs field of A. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?B#C fs - Test for B not equal to C --------- fs = A opcode: 8A5yy @@ -2462,7 +2473,7 @@ A_Standard_Assembly_Language_Header Test whether the fs field of B is not equal to the fs field of C. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. - Page 52 ?B<=C fs - Test for B less than or equal to C + ?B<=C fs - Test for B less than or equal to C --------- fs = A opcode: 8BDyy cycles: 13 + d (GO/RTNYES) @@ -2476,6 +2487,7 @@ A_Standard_Assembly_Language_Header fs field of C. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?B=C fs - Test for B greater than or equal to C --------- fs = A opcode: 8B9yy @@ -2544,7 +2559,7 @@ A_Standard_Assembly_Language_Header mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. - Page 54 ?B>C fs - Test for B greater than C + ?B>C fs - Test for B greater than C --------- fs = A opcode: 8B1yy cycles: 13 + d (GO/RTNYES) @@ -2557,6 +2572,7 @@ A_Standard_Assembly_Language_Header Test whether the fs field of B is greater than the fs field of C. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?C#0 fs - Test for C not equal to 0 --------- fs = A opcode: 8AEyy @@ -2570,6 +2586,7 @@ A_Standard_Assembly_Language_Header Test whether the fs field of C is not equal to 0. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?C#A fs - Test for C not equal to A --------- fs = A opcode: 8A6yy @@ -2584,8 +2601,7 @@ A_Standard_Assembly_Language_Header of A. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. - - Page 55 ?C#B fs - Test for C not equal to B + ?C#B fs - Test for C not equal to B --------- fs = A opcode: 8A5yy cycles: 13 + d (GO/RTNYES) @@ -2598,6 +2614,7 @@ A_Standard_Assembly_Language_Header Test whether the fs field of C is not equal to the fs field of B. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?C#D fs - Test for C not equal to D --------- fs = A opcode: 8A7yy @@ -2611,6 +2628,7 @@ A_Standard_Assembly_Language_Header Test whether the fs field of C is not equal to the fs field of D. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?C<=A fs - Test for C less than or equal to A --------- fs = A opcode: 8BEyy @@ -2626,7 +2644,7 @@ A_Standard_Assembly_Language_Header mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. - Page 56 ?C=A fs - Test for C greater than or equal to A --------- fs = A opcode: 8BAyy @@ -2720,6 +2742,7 @@ A_Standard_Assembly_Language_Header Test whether the fs field of C is greater than the fs field of A. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?D#0 fs - Test for D not equal to 0 --------- fs = A opcode: 8AFyy @@ -2733,6 +2756,7 @@ A_Standard_Assembly_Language_Header Test whether the fs field of D is not equal to 0. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?D#C fs - Test for D not equal to C --------- fs = A opcode: 8A7yy @@ -2747,7 +2771,6 @@ A_Standard_Assembly_Language_Header of C. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. - ?D<=C fs - Test for D less than or equal to C --------- fs = A opcode: 8BFyy @@ -2762,6 +2785,7 @@ A_Standard_Assembly_Language_Header fs field of C. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?D=C fs - Test for D greater than or equal to C --------- fs = A opcode: 8BByy @@ -2816,6 +2842,7 @@ A_Standard_Assembly_Language_Header the fs field of C. Must be followed by a GOYES or RTNYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?D>C fs - Test for D greater than C --------- fs = A opcode: 8B3yy @@ -2843,6 +2870,7 @@ A_Standard_Assembly_Language_Header "HP-71 Hardware Specification" for more information. Must be followed by a RTNYES or GOYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?P# n - Test if P pointer not equal to n --------- opcode: 88nyy @@ -2852,6 +2880,7 @@ A_Standard_Assembly_Language_Header Test whether the P pointer is not equal to n. Must be followed by a RTNYES or GOYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?P= n - Test if P pointer is equal to n --------- opcode: 89nyy @@ -2861,6 +2890,7 @@ A_Standard_Assembly_Language_Header Test whether the P pointer is equal to n. Must be followed by a RTNYES or GOYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?SB=0 - Test Sticky Bit (SB) --------- opcode: 832yy @@ -2874,8 +2904,6 @@ A_Standard_Assembly_Language_Header GOYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. - - ?SR=0 - Test Service Request bit (SR) for zero --------- opcode: 834yy @@ -2887,6 +2915,7 @@ A_Standard_Assembly_Language_Header be cleared explicitly by the SR=0 instruciton. Must be followed by a RTNYES or GOYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?ST#0 n - Test status bit n not equal to 0 --------- opcode: 87nyy @@ -2896,6 +2925,7 @@ A_Standard_Assembly_Language_Header Test whether Program Status bit n is set. Must be followed by a RTNYES or GOYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?ST#1 n - Test status bit n not equal to 1 --------- opcode: 86nyy @@ -2905,6 +2935,7 @@ A_Standard_Assembly_Language_Header Test whether Program Status bit n is clear. Must be followed by a RTNYES or GOYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?ST=0 n - Test status bit n equal to 0 --------- opcode: 86nyy @@ -2915,8 +2946,6 @@ A_Standard_Assembly_Language_Header by a RTNYES or GOYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. - - ?ST=1 n - Test status bit n equal to 1 --------- opcode: 87nyy @@ -2926,6 +2955,7 @@ A_Standard_Assembly_Language_Header Test whether Program Status bit n is set. Must be followed by a RTNYES or GOYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + ?XM=0 - Test External Module Missing bit (XM) --------- opcode: 831yy @@ -2938,6 +2968,7 @@ A_Standard_Assembly_Language_Header mnemonic. Must be followed by a RTNYES or GOYES mnemonic. yy is determined by the following RTNYES or GOYES. Adjusts Carry. + A=-A fs - Two's complement of A into A --------- fs = A opcode: F8 @@ -2950,6 +2981,7 @@ A_Standard_Assembly_Language_Header complement if in HEX mode, ten's complement if in DEC mode. Carry is set if the field is not zero, else Carry is cleared. + A=-A-1 fs - One's complement of A into A --------- fs = A opcode: FC @@ -2961,8 +2993,6 @@ A_Standard_Assembly_Language_Header Perform a one's complement on the specified fs field of A. Carry is always cleared. - - A=0 fs - Set A equal to 0 --------- fs = A opcode: D0 @@ -2973,6 +3003,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of A to zero. Carry is not affected. + A=A!B fs - A OR B into A --------- fs = A opcode: 0EF8 @@ -2994,6 +3025,7 @@ A_Standard_Assembly_Language_Header Set the fs field of register A to its logical OR with the corresponding field of register C. Carry is not affected. + A=A&B fs - A AND B into A --------- fs = A opcode: 0EF0 @@ -3004,7 +3036,8 @@ A_Standard_Assembly_Language_Header Set the fs field of register A to its logical AND with the corresponding field of register B. Carry is not affected. - Page 65 A=A&C fs - A AND C into A + + A=A&C fs - A AND C into A --------- fs = A opcode: 0EF6 cycles: 4 + d @@ -3014,6 +3047,7 @@ A_Standard_Assembly_Language_Header Set the fs field of register A to its logical AND with the corresponding field of register C. Carry is not affected. + A=A+1 fs - Increment A --------- fs = A opcode: E4 @@ -3024,6 +3058,7 @@ A_Standard_Assembly_Language_Header Increment the specified fs field of register A by one. Adjusts Carry. + A=A+A fs - Sum of A and A into A --------- fs = A opcode: C4 @@ -3033,6 +3068,7 @@ A_Standard_Assembly_Language_Header cycles: 3 + d Double the specified fs field of register A. Adjusts Carry. + A=A+B fs - Sum of A and B into A --------- fs = A opcode: C0 @@ -3056,6 +3092,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register A to the sum of itself and the corresponding field of register C. Adjusts Carry. + A=A-1 fs - Decrement A --------- fs = A opcode: CC @@ -3066,6 +3103,7 @@ A_Standard_Assembly_Language_Header Decrement the specified fs field of register A by one. Adjusts Carry. + A=A-B fs - A minus B into A --------- fs = A opcode: E0 @@ -3077,6 +3115,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register A to the difference between itself and the corresponding field of register B. Adjusts Carry. + A=A-C fs - A minus C into A --------- fs = A opcode: EA @@ -3089,7 +3128,6 @@ A_Standard_Assembly_Language_Header between itself and the corresponding field of register C. Adjusts Carry. - A=B fs - Copy B to A --------- fs = A opcode: D4 @@ -3100,6 +3138,7 @@ A_Standard_Assembly_Language_Header Copy the fs field of register B into the corresponding field of register A. Carry is not affected. + A=B-A fs - B minus A into A --------- fs = A opcode: EC @@ -3169,7 +3208,6 @@ A_Standard_Assembly_Language_Header register starting at nibble 0. See the section on "Loading Data From Memory". - A=IN - Load A with IN --------- opcode: 802 @@ -3177,6 +3215,7 @@ A_Standard_Assembly_Language_Header Load the low-order 4 nibbles of the A register with the contents of the Input register. + A=R0 - Copy R0 to A --------- opcode: 110 @@ -3184,6 +3223,7 @@ A_Standard_Assembly_Language_Header The contents of the scratch register R0 is copied to the working register A. + A=R1 - Copy R1 to A --------- opcode: 111 @@ -3191,6 +3231,7 @@ A_Standard_Assembly_Language_Header The contents of the scratch register R1 is copied to the working register A. + A=R2 - Copy R2 to A --------- opcode: 112 @@ -3198,6 +3239,7 @@ A_Standard_Assembly_Language_Header The contents of the scratch register R2 is copied to the working register A. + A=R3 - Copy R3 to A --------- opcode: 113 @@ -3213,6 +3255,7 @@ A_Standard_Assembly_Language_Header The contents of the scratch register R4 is copied to the working register A. + ABEX fs - Exchange Registers A and B --------- fs = A opcode: DC @@ -3223,6 +3266,7 @@ A_Standard_Assembly_Language_Header Exchange the fs fields of registers of A and B. Carry is not affected. + ACEX fs - Exchange Registers A and C --------- fs = A opcode: DE @@ -3233,6 +3277,7 @@ A_Standard_Assembly_Language_Header Exchange the fs fields of registers of A and C. Carry is not affected. + AD0EX - Exchange A and D0 (nibs 0-4) --------- opcode: 132 @@ -3241,7 +3286,6 @@ A_Standard_Assembly_Language_Header Exchange the A field of register A with Data pointer D0. Carry is not affected. - AD0XS - Exchange A and D0 short (nibs 0-3) --------- opcode: 13A @@ -3249,6 +3293,7 @@ A_Standard_Assembly_Language_Header Exchange the lower 4 nibbles of A with the lower 4 nibbles of Data pointer D0. Carry is not affected. + AD1EX - Exchange A and D1 (nibs 0-4) --------- opcode: 133 @@ -3256,6 +3301,7 @@ A_Standard_Assembly_Language_Header Exchange the A field of register A with Data pointer D1. Carry is not affected. + AD1XS - Exchange A and D1 short (nibs 0-3) --------- opcode: 13B @@ -3263,6 +3309,7 @@ A_Standard_Assembly_Language_Header Exchange the lower 4 nibbles of A with the lower 4 nibbles of Data pointer D1. Carry is not affected. + AR0EX - Exchange A and R0 --------- opcode: 120 @@ -3270,6 +3317,7 @@ A_Standard_Assembly_Language_Header Exchange the contents of the working register A and the scratch register R0. + AR1EX - Exchange A and R1 --------- opcode: 121 @@ -3285,6 +3333,7 @@ A_Standard_Assembly_Language_Header Exchange the contents of the working register A and the scratch register R2. + AR3EX - Exchange A and R3 --------- opcode: 123 @@ -3292,6 +3341,7 @@ A_Standard_Assembly_Language_Header Exchange the contents of the working register A and the scratch register R3. + AR4EX - Exchange A and R4 --------- opcode: 124 @@ -3299,6 +3349,7 @@ A_Standard_Assembly_Language_Header Exchange the contents of the working register A and the scratch register R4. + ASL fs - A Shift Left --------- fs = A opcode: F0 @@ -3313,7 +3364,6 @@ A_Standard_Assembly_Language_Header The new low-order nibble of the field is zero. The Sticky Bit (SB) is not affected. - ASLC - A Shift Left Circular --------- opcode: 810 @@ -3321,6 +3371,7 @@ A_Standard_Assembly_Language_Header Circular shift register A left one nibble. Operates on all 16 digits. The Sticky Bit (SB) is not affected. + ASR fs - A Shift Right --------- fs = A opcode: F4 @@ -3334,6 +3385,7 @@ A_Standard_Assembly_Language_Header register. The nibble shifted off the right end of the field is lost, but the Sticky Bit (SB) is set if the nibble was non-zero. The new high-order nibble of the field is zero. + ASRB - A Shift Right Bit --------- opcode: 81C @@ -3343,6 +3395,7 @@ A_Standard_Assembly_Language_Header The bit shifted off the end is lost, but the Sticky Bit (SB) is set if it was non-zero. The new high-order bit of the register is zero. + ASRC - A Shift Right Circular --------- opcode: 814 @@ -3364,6 +3417,7 @@ A_Standard_Assembly_Language_Header complement if in HEX mode, ten's complement if in DEC mode. Carry is set if the field is not zero, else Carry is cleared. + B=-B-1 fs - One's complement of B into B --------- fs = A opcode: FD @@ -3374,6 +3428,7 @@ A_Standard_Assembly_Language_Header Perform a one's complement on the specified fs field of B. Carry is always cleared. + B=0 fs - Set B equal to 0 --------- fs = A opcode: D1 @@ -3384,6 +3439,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of B to zero. Carry is not affected. + B=A fs - Copy A to B --------- fs = A opcode: D8 @@ -3405,6 +3461,7 @@ A_Standard_Assembly_Language_Header Set the fs field of register B to its logical OR with the corresponding field of register A. Carry is not affected. + B=B!C fs - B OR C into B --------- fs = A opcode: 0EF9 @@ -3415,6 +3472,7 @@ A_Standard_Assembly_Language_Header Set the fs field of register B to its logical OR with the corresponding field of register C. Carry is not affected. + B=B&A fs - B AND A into B --------- fs = A opcode: 0EF4 @@ -3425,6 +3483,7 @@ A_Standard_Assembly_Language_Header Set the fs field of register B to its logical AND with the corresponding field of register A. Carry is not affected. + B=B&C fs - B AND C into B --------- fs = A opcode: 0EF1 @@ -3436,7 +3495,7 @@ A_Standard_Assembly_Language_Header Set the fs field of register B to its logical AND with the corresponding field of register C. Carry is not affected. - Page 76 B=B+1 fs - Increment B + B=B+1 fs - Increment B --------- fs = A opcode: E5 cycles: 7 @@ -3446,6 +3505,7 @@ A_Standard_Assembly_Language_Header Increment the specified fs field of register B by one. Adjusts Carry. + B=B+A fs - Sum of B and A into B --------- fs = A opcode: C8 @@ -3457,6 +3517,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register B to the sum of itself and the corresponding field of register A. Adjusts Carry. + B=B+B fs - Sum of B and B into B --------- fs = A opcode: C5 @@ -3466,6 +3527,7 @@ A_Standard_Assembly_Language_Header cycles: 3 + d Double the specified fs field of register B. Adjusts Carry. + B=B+C fs - Sum of B and C into B --------- fs = A opcode: C1 @@ -3477,6 +3539,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register B to the sum of itself and the corresponding field of register C. Adjusts Carry. + B=B-1 fs - Decrement B --------- fs = A opcode: CD @@ -3487,6 +3550,7 @@ A_Standard_Assembly_Language_Header Decrement the specified fs field of register B by one. Adjusts Carry. + B=B-A fs - B minus A into B --------- fs = A opcode: E8 @@ -3498,6 +3562,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register B to the difference between itself and the corresponding field of register A. Adjusts Carry. + B=B-C fs - B minus C into B --------- fs = A opcode: E1 @@ -3509,6 +3574,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register B to the difference between itself and the corresponding field of register C. Adjusts Carry. + B=C fs - Copy C to B --------- fs = A opcode: D5 @@ -3519,6 +3585,7 @@ A_Standard_Assembly_Language_Header Copy the fs field of register C into the corresponding field of register B. Carry is not affected. + B=C-B fs - C minus B into B --------- fs = A opcode: ED @@ -3530,6 +3597,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register B to the inverse difference between itself and the corresponding field of register C. Adjusts Carry. + BAEX fs - Exchange Registers B and A --------- fs = A opcode: DC @@ -3540,6 +3608,7 @@ A_Standard_Assembly_Language_Header Exchange the fs fields of registers of B and A. Carry is not affected. + BCEX fs - Exchange Registers B and C --------- fs = A opcode: DD @@ -3549,7 +3618,9 @@ A_Standard_Assembly_Language_Header cycles: 3 + d Exchange the fs fields of registers of B and C. Carry is not - affected. BSL fs - B Shift Left + affected. + + BSL fs - B Shift Left --------- fs = A opcode: F1 cycles: 7 @@ -3563,8 +3634,6 @@ A_Standard_Assembly_Language_Header The new low-order nibble of the field is zero. The Sticky Bit (SB) is not affected. - - BSLC - B Shift Left Circular --------- opcode: 811 @@ -3572,6 +3641,7 @@ A_Standard_Assembly_Language_Header Circular shift register B left one nibble. Operates on all 16 digits. The Sticky Bit (SB) is not affected. + BSR fs - B Shift Right --------- fs = A opcode: F5 @@ -3585,6 +3655,7 @@ A_Standard_Assembly_Language_Header register. The nibble shifted off the right end of the field is lost, but the Sticky Bit (SB) is set if the nibble was non-zero. The new high-order nibble of the field is zero. + BSRB - B Shift Right Bit --------- opcode: 81D @@ -3604,8 +3675,6 @@ A_Standard_Assembly_Language_Header 16 digits. The Sticky Bit (SB) is set if the nibble shifted from low-order around to high-order position was non-zero. - - BUSCC - Bus Command "C" --------- opcode: 80B @@ -3615,6 +3684,7 @@ A_Standard_Assembly_Language_Header command is reserved for later use). No other operation is performed. See the "HP-71 Hardware Specification" for more information. + C+P+1 - Increment C by One Plus P Pointer --------- opcode: 809 @@ -3623,6 +3693,7 @@ A_Standard_Assembly_Language_Header The A field of the C register is incremented by one plus the value of the P pointer. This instruction is always executed in HEX mode. Adjusts Carry. + C=-C fs - Two's complement of C into C --------- fs = A opcode: FA @@ -3635,6 +3706,7 @@ A_Standard_Assembly_Language_Header complement if in HEX mode, ten's complement if in DEC mode. Carry is set if the field is not zero, else Carry is cleared. + C=-C-1 fs - One's complement of C into C --------- fs = A opcode: FE @@ -3656,6 +3728,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of C to zero. Carry is not affected. + C=A fs - Copy A to C --------- fs = A opcode: D6 @@ -3666,6 +3739,7 @@ A_Standard_Assembly_Language_Header Copy the fs field of register A into the corresponding field of register C. Carry is not affected. + C=A-C fs - A minus C into C --------- fs = A opcode: EE @@ -3677,6 +3751,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register C to the inverse difference between itself and the corresponding field of register A. Adjusts Carry. + C=B fs - Copy B to C --------- fs = A opcode: D9 @@ -3687,6 +3762,7 @@ A_Standard_Assembly_Language_Header Copy the fs field of register B into the corresponding field of register C. Carry is not affected. + C=C!A fs - C OR A into C --------- fs = A opcode: 0EFA @@ -3697,6 +3773,7 @@ A_Standard_Assembly_Language_Header Set the fs field of register C to its logical OR with the corresponding field of register A. Carry is not affected. + C=C!B fs - C OR B into C --------- fs = A opcode: 0EFD @@ -3707,6 +3784,7 @@ A_Standard_Assembly_Language_Header Set the fs field of register C to its logical OR with the corresponding field of register B. Carry is not affected. + C=C!D fs - C OR D into C --------- fs = A opcode: 0EFF @@ -3717,6 +3795,7 @@ A_Standard_Assembly_Language_Header Set the fs field of register C to its logical OR with the corresponding field of register D. Carry is not affected. + C=C&A fs - C AND A into A --------- fs = A opcode: 0EF2 @@ -3728,7 +3807,7 @@ A_Standard_Assembly_Language_Header Set the fs field of register C to its logical AND with the corresponding field of register A. Carry is not affected. - Page 83 C=C&B fs - C AND B into C + C=C&B fs - C AND B into C --------- fs = A opcode: 0EF5 cycles: 4 + d @@ -3738,6 +3817,7 @@ A_Standard_Assembly_Language_Header Set the fs field of register C to its logical AND with the corresponding field of register B. Carry is not affected. + C=C&D fs - C AND D into C --------- fs = A opcode: 0EF7 @@ -3748,6 +3828,7 @@ A_Standard_Assembly_Language_Header Set the fs field of register C to its logical AND with the corresponding field of register D. Carry is not affected. + C=C+1 fs - Increment C --------- fs = A opcode: E6 @@ -3758,6 +3839,7 @@ A_Standard_Assembly_Language_Header Increment the specified fs field of register C by one. Adjusts Carry. + C=C+A fs - Sum of C and A into C --------- fs = A opcode: C2 @@ -3769,6 +3851,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register C to the sum of itself and the corresponding field of register A. Adjusts Carry. + C=C+B fs - Sum of C and B into C --------- fs = A opcode: C9 @@ -3780,6 +3863,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register C to the sum of itself and the corresponding field of register B. Adjusts Carry. + C=C+C fs - Sum of C and C into C --------- fs = A opcode: C6 @@ -3789,6 +3873,7 @@ A_Standard_Assembly_Language_Header cycles: 3 + d Double the specified fs field of register C. Adjusts Carry. + C=C+D fs - Sum of C and D into C --------- fs = A opcode: CB @@ -3800,6 +3885,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register C to the sum of itself and the corresponding field of register D. Adjusts Carry. + C=C-1 fs - Decrement C --------- fs = A opcode: CE @@ -3810,7 +3896,8 @@ A_Standard_Assembly_Language_Header Decrement the specified fs field of register C by one. Adjusts Carry. - Page 85 C=C-A fs - C minus A into C + + C=C-A fs - C minus A into C --------- fs = A opcode: E2 cycles: 7 @@ -3821,6 +3908,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register C to the difference between itself and the corresponding field of register A. Adjusts Carry. + C=C-B fs - C minus B into C --------- fs = A opcode: E9 @@ -3832,6 +3920,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register C to the difference between itself and the corresponding field of register B. Adjusts Carry. + C=C-D fs - C minus D into C --------- fs = A opcode: EB @@ -3843,6 +3932,7 @@ A_Standard_Assembly_Language_Header Set the specified fs field of register C to the difference between itself and the corresponding field of register D. Adjusts Carry. + C=D fs - Copy D to C --------- fs = A opcode: DB @@ -3854,8 +3944,6 @@ A_Standard_Assembly_Language_Header Copy the fs field of register D into the corresponding field of register C. Carry is not affected. - - C=DAT0 fsd - Load C from memory --------- fs = A opcode: 146 @@ -3878,6 +3966,7 @@ A_Standard_Assembly_Language_Header nibbles. If fs = d, d nibbles are transferred into the register starting at nibble 0. See the section on "Loading Data From Memory". + C=DAT1 fsd - Load C from memory --------- fs = A opcode: 147 @@ -3901,7 +3990,6 @@ A_Standard_Assembly_Language_Header register starting at nibble 0. See the section on "Loading Data From Memory". - C=ID - Request chip ID --------- opcode: 806 @@ -3911,6 +3999,7 @@ A_Standard_Assembly_Language_Header configuration flag low will send its 5 nibble ID register to the system bus which will be loaded into the low-order 5 nibbles (A field) of the C register. + C=IN - Load C with IN --------- opcode: 803 @@ -3918,6 +4007,7 @@ A_Standard_Assembly_Language_Header Load the low-order 4 nibbles of the C register with the contents of the Input register. + C=P n - Copy P Pointer into Nibble n of C --------- opcode: 80Cn @@ -3925,6 +4015,7 @@ A_Standard_Assembly_Language_Header Copy P pointer into C register at digit position specified by n. + C=R0 - Copy R0 to C --------- opcode: 118 @@ -3932,19 +4023,23 @@ A_Standard_Assembly_Language_Header The contents of the scratch register R0 is copied to the working register C. + C=R1 - Copy R1 to C --------- opcode: 119 cycles: 19 The contents of the scratch register R1 is copied to the - working register C. Page 88 C=R2 - Copy R2 to C + working register C. + + C=R2 - Copy R2 to C --------- opcode: 11A cycles: 19 The contents of the scratch register R2 is copied to the working register C. + C=R3 - Copy R3 to C --------- opcode: 11B @@ -3952,6 +4047,7 @@ A_Standard_Assembly_Language_Header The contents of the scratch register R3 is copied to the working register C. + C=R4 - Copy R4 to C --------- opcode: 11C @@ -3959,6 +4055,7 @@ A_Standard_Assembly_Language_Header The contents of the scratch register R4 is copied to the working register C. + C=RSTK - Pop stack to C --------- opcode: 07 @@ -3978,6 +4075,7 @@ A_Standard_Assembly_Language_Header Copy the low-order 12 bits of the status register into the low-order 12 bits (X field) of the C register. + CAEX fs - Exchange Registers C and A --------- fs = A opcode: DE @@ -3988,6 +4086,7 @@ A_Standard_Assembly_Language_Header Exchange the fs fields of registers of C and A. Carry is not affected. + CBEX fs - Exchange Registers C and B --------- fs = A opcode: DD @@ -3998,6 +4097,7 @@ A_Standard_Assembly_Language_Header Exchange the fs fields of registers of C and B. Carry is not affected. + CD0EX - Exchange C and D0 (nibs 0-4) --------- opcode: 136 @@ -4006,7 +4106,6 @@ A_Standard_Assembly_Language_Header Exchange the A field of register C with Data pointer D0. Carry is not affected. - CD0XS - Exchange C and D0 short (nibs 0-3) --------- opcode: 13E @@ -4014,6 +4113,7 @@ A_Standard_Assembly_Language_Header Exchange the lower 4 nibbles of C with the lower 4 nibbles of Data pointer D0. Carry is not affected. + CD1EX - Exchange C and D1 (nibs 0-4) --------- opcode: 137 @@ -4021,6 +4121,7 @@ A_Standard_Assembly_Language_Header Exchange the A field of register C with Data pointer D1. Carry is not affected. + CD1XS - Exchange C and D1 short (nibs 0-3) --------- opcode: 13F @@ -4028,6 +4129,7 @@ A_Standard_Assembly_Language_Header Exchange the lower 4 nibbles of C with the lower 4 nibbles of Data pointer D1. Carry is not affected. + CDEX fs - Exchange Registers C and D --------- fs = A opcode: DF @@ -4056,6 +4158,7 @@ A_Standard_Assembly_Language_Header For example opcode 829 clears XM and MP. Although there is no mnemonic for this, the opcode can be inserted into the code by using, for example, NIBHEX 829. + CLRST - Clear Program Status --------- opcode: 08 @@ -4063,6 +4166,7 @@ A_Standard_Assembly_Language_Header Clear the low-order 12 bits (S0 through S11) of the Program Status register ST. + CONFIG - Configure --------- opcode: 805 @@ -4072,6 +4176,7 @@ A_Standard_Assembly_Language_Header into the Configuration register of the chip which has its DAISY-IN line high and its configuration flag low. See the "HP-71 Hardware Specification" for information. + CPEX n - Exchange Nibble n of C With P Pointer --------- opcode: 80Fn @@ -4079,7 +4184,6 @@ A_Standard_Assembly_Language_Header Exchange the P pointer with digit n of the C register. - CR0EX - Exchange C and R0 --------- opcode: 128 @@ -4087,6 +4191,7 @@ A_Standard_Assembly_Language_Header Exchange the contents of the working register C and the scratch register R0. + CR1EX - Exchange C and R1 --------- opcode: 129 @@ -4094,6 +4199,7 @@ A_Standard_Assembly_Language_Header Exchange the contents of the working register C and the scratch register R1. + CR2EX - Exchange C and R2 --------- opcode: 12A @@ -4101,6 +4207,7 @@ A_Standard_Assembly_Language_Header Exchange the contents of the working register C and the scratch register R2. + CR3EX - Exchange C and R3 --------- opcode: 12B @@ -4109,8 +4216,6 @@ A_Standard_Assembly_Language_Header Exchange the contents of the working register C and the scratch register R3. - - CR4EX - Exchange C and R4 --------- opcode: 12C @@ -4118,6 +4223,7 @@ A_Standard_Assembly_Language_Header Exchange the contents of the working register C and the scratch register R4. + CSL fs - C Shift Left --------- fs = A opcode: F2 @@ -4153,6 +4259,7 @@ A_Standard_Assembly_Language_Header register. The nibble shifted off the right end of the field is lost, but the Sticky Bit (SB) is set if the nibble was non-zero. The new high-order nibble of the field is zero. + CSRB - C Shift Right Bit --------- opcode: 81E @@ -4162,6 +4269,7 @@ A_Standard_Assembly_Language_Header The bit shifted off the end is lost, but the Sticky Bit (SB) is set if it was non-zero. The new high-order bit of the register is zero. + CSRC - C Shift Right Circular --------- opcode: 816 @@ -4171,7 +4279,6 @@ A_Standard_Assembly_Language_Header 16 digits. The Sticky Bit (SB) is set if the nibble shifted from low-order around to high-order position was non-zero. - CSTEX - Exchange Status --------- opcode: 0B @@ -4193,6 +4300,7 @@ A_Standard_Assembly_Language_Header executed the data will be loaded into the register with the intended orientation. See the section on "Loading Data From Memory". + D0=(4) nnnn - Load 4 Nibbles Into D0 ------------ opcode: 1Annnn @@ -4225,6 +4333,7 @@ A_Standard_Assembly_Language_Header The A field of register A is copied into Data pointer register D0. Carry is not affected. + D0=AS - Copy A to D0 short (nibs 0-3) --------- opcode: 138 @@ -4232,6 +4341,7 @@ A_Standard_Assembly_Language_Header The lower 4 nibbles of A are copied into the lower 4 nibbles of Data pointer register D0. Carry is not affected. + D0=C - Copy C to D0 (nibs 0-4) --------- opcode: 134 @@ -4239,6 +4349,7 @@ A_Standard_Assembly_Language_Header The A field of register C is copied into Data pointer register D0. Carry is not affected. + D0=CS - Copy C to D0 short (nibs 0-3) --------- opcode: 13C @@ -4247,7 +4358,6 @@ A_Standard_Assembly_Language_Header The lower 4 nibbles of C are copied into the lower 4 nibbles of Data pointer register D0. Carry is not affected. - D0=D0+ n - Add n to D0 (1<=n<=16) --------- opcode: 16x (x=n-1) @@ -4255,12 +4365,15 @@ A_Standard_Assembly_Language_Header Increment D0 by n. This instruction is always executed in HEX mode. Adjusts Carry. - D0=D0- n - Subtract n from D0 (1<=n<=16) --------- + + D0=D0- n - Subtract n from D0 (1<=n<=16) + --------- opcode: 18x (x=n-1) cycles: 7 Decrement D0 by n. This instruction is always executed in HEX mode. Adjusts Carry. + D0=HEX hh - Load D0 with hex constant hh --------- opcode: 19hh @@ -4655,6 +4768,7 @@ A_Standard_Assembly_Language_Header Exchange the fs fields of registers of D and C. Carry is not affected. + DSL fs - D Shift Left --------- fs = A opcode: F3 @@ -4932,14 +5046,14 @@ A_Standard_Assembly_Language_Header fifth nibble in the opcode is a place holder and is jumped over. The mnemonic effectively skips five nibbles. - OUT=C - Load 3 nibbles of OR ----- + OUT=C - Load 3 nibbles of OR + ----- opcode: 801 cycles: 6 All nibbles of the Output register are loaded with the low- order three nibbles of C (X field). - OUT=CS - Load 1 nibble of OR ------ opcode: 800 diff --git a/include/sload.h b/include/sload.h index da86ea0..e0aa09b 100755 --- a/include/sload.h +++ b/include/sload.h @@ -149,7 +149,7 @@ extern void listit(char *); extern void errmsg(char *); #define MSG1(x) { \ - if (fprintf(msgfile, x) < 0 || putc('\n', msgfile) == EOF) \ + if (fprintf(msgfile, "%s", x) < 0 || putc('\n', msgfile) == EOF) \ error("error writing to message file (%s)", msgname); \ } #define MSG2(x,y) { \ diff --git a/makerom/makerom.c b/makerom/makerom.c index 7d85c15..97f5625 100755 --- a/makerom/makerom.c +++ b/makerom/makerom.c @@ -811,12 +811,12 @@ void read_ext(char *file_name) parse_external(buf); break; } - fclose(tmpfp); - /* Kludge!!! stupid fopen() on some stations garble input string - fprintf(outfp, "** Parsing %s\n", tmp_name); *current* */ - fprintf(outfp, "** Parsing %s\n", conc_ext(file_name, "ext", TRUE ) ); - } else { - fprintf(outfp, "** Could not open %s\n", tmp_name); + fclose(tmpfp); + /* Kludge!!! stupid fopen() on some stations garble input string + fprintf(outfp, "** Parsing %s\n", tmp_name); *current* */ + fprintf(outfp, "** Parsing %s\n", conc_ext(file_name, "ext", TRUE ) ); + } else { + fprintf(outfp, "** Could not open %s\n", tmp_name); } } diff --git a/rplcomp/defer.c b/rplcomp/defer.c index 251f994..ce72eeb 100755 --- a/rplcomp/defer.c +++ b/rplcomp/defer.c @@ -6,21 +6,28 @@ #include #include #include + #ifdef HAVE_STRING_H # include #else # include #endif -#ifndef macintosh -# include + +#ifdef __APPLE__ +# include +#else +# ifndef __FreeBSD__ +# include +# endif #endif + #include #include "rplcomp.h" #include "defer.h" #ifdef dll -#include "dllfile.h" +# include "dllfile.h" #endif void drop_ary(int flag, struct LINE *line) diff --git a/rplcomp/masd.c b/rplcomp/masd.c index 924b70e..593c059 100755 --- a/rplcomp/masd.c +++ b/rplcomp/masd.c @@ -6,21 +6,28 @@ #include #include #include + #ifdef HAVE_STRING_H # include #else # include #endif -#ifndef macintosh -# include + +#ifdef __APPLE__ +# include +#else +# ifndef __FreeBSD__ +# include +# endif #endif + #include #include "rplcomp.h" #include "envfile.h" #ifdef dll -#include "dllfile.h" +# include "dllfile.h" #endif int MASD_LongCteError= TRUE; diff --git a/rplcomp/rplcomp.c b/rplcomp/rplcomp.c index 486a845..7a006c3 100755 --- a/rplcomp/rplcomp.c +++ b/rplcomp/rplcomp.c @@ -325,7 +325,7 @@ void add_ctrl_stk( int ofs ) void err_std( char *err ) { - fprintf( stderr, err ); + fprintf( stderr, "%s", err ); exit( 1 ); } @@ -1856,7 +1856,7 @@ void dobind(void) token = nextqfield(); if(strcmp("}}",token)) { strncpy(tmpname[binds], token, 14); - tmpname[binds][15] = '\0'; + tmpname[binds][14] = '\0'; binds++; } else diff --git a/sasm/sasm.c b/sasm/sasm.c index d5256f6..64f21a4 100755 --- a/sasm/sasm.c +++ b/sasm/sasm.c @@ -385,7 +385,7 @@ void writeheader() if (codeonly == TRUE) return; - (void) strncpy(headerout.saturn.id, SAT_ID, sizeof(SAT_ID)); + (void) strncpy(headerout.saturn.id, SAT_ID, sizeof(headerout.saturn.id)); set_16((char *)&headerout.saturn.length, (b_16) ( /* one block for the Saturn header itself */ @@ -1902,7 +1902,7 @@ int main(int argc, char **argv) *mnemonic = '\0'; *label = '\0'; listflags &= ~ LIST_SUPPRESS; - if (imtype == (NO_IM && (listflags & LIST_CODE) + if (imtype == ((NO_IM && (listflags & LIST_CODE)) || (imtype==START_MACRO && (listflags&LIST_MACRO)) || (imtype==START_INCLUDE && (listflags&LIST_INCLUDE)) )) diff --git a/sload/symb.c b/sload/symb.c index 009bb38..925664b 100755 --- a/sload/symb.c +++ b/sload/symb.c @@ -8,7 +8,7 @@ #include "sptree.h" -static SYMBOLPTR symtree; +SYMBOLPTR symtree; int lookups=0, lkcmps=0, adds=0; b_16 symbols; diff --git a/support/Makefile.in b/support/Makefile.in index d7cb96a..5155f23 100755 --- a/support/Makefile.in +++ b/support/Makefile.in @@ -34,9 +34,9 @@ TARGETS = makerom rplcomp sasm sload RPLCOMPOBJS = debug.o hash.o rplcomp.o version.o masd.o defer.o envfile.o error.o SASMOBJS = convert.o debug.o error.o expr.o opcodegen.o \ - opcode.o symbols.o sasm.o version.o getopt.o envfile.o + opcode.o symbols.o sasm.o version.o envfile.o -SLOADOBJS = convert.o debug.o error.o code.o getopt.o input.o \ +SLOADOBJS = convert.o debug.o error.o code.o input.o \ output.o sload.o sptree.o symb.o version.o envfile.o all: $(TARGETS)