Skip to main content
Fixed some obvious typos.
Source Link
dirkt
  • 34.7k
  • 4
  • 87
  • 141

All statements are marked with a leasingleading dollar sign ($). Most require parameters:

  • Primary structure statements may carry a specifier to select a variant.
  • Conditional statements take
    • an 8086 condition codescode,
    • an optional logical operator (AND/OR) and
    • an optional distance marker (8086 short vs near)

All conditional statements must have condition creating statement(s) (like a CMP) before it'sits placement as SALUT does only do line by line replacement, no reordering or code analysis.

For examplesExamples for all cases will be in the IF section below.

As well as their counter artsparts:

All statements are marked with a leasing dollar sign ($). Most require parameters:

  • Primary structure statements may carry a specifier to select a variant.
  • Conditional statements take
    • an 8086 condition codes,
    • an optional logical operator (AND/OR) and
    • an optional distance marker (8086 short vs near)

All conditional statements must have condition creating statement(s) (like a CMP) before it's placement as SALUT does only do line by line replacement, no reordering or code analysis.

For examples for all cases will be in the IF section below.

As well as their counter arts:

All statements are marked with a leading dollar sign ($). Most require parameters:

  • Primary structure statements may carry a specifier to select a variant.
  • Conditional statements take
    • an 8086 condition code,
    • an optional logical operator (AND/OR) and
    • an optional distance marker (8086 short vs near)

All conditional statements must have condition creating statement(s) (like a CMP) before its placement as SALUT does only do line by line replacement, no reordering or code analysis.

Examples for all cases will be in the IF section below.

As well as their counter parts:

Some typos
Source Link
Raffzahn
  • 249.5k
  • 23
  • 722
  • 1k

But there'sThere's a third party book with a section about SALUT,

which is even available at archive.org (registration required to 'borrow').

Here a short writeupwrite-up of what I remembered when browsing thru the SALEX1.SAL file. Hope it's what you're looking for.

Condition creating code may be anything or nothing at all. The $IF statement will be turned into the rejecting (inverse) version of that jump, i.e. E is turned into NE and vice versa. If an $ELSE statmentstatement is present it will generate an uncoditionalunconditional (short) jump around the following code toward the label generated by $ENDIF.

But there's a third party book with a section about SALUT,

which is even available at archive.org (registration required to 'borrow'.

Here a short writeup of what I remembered when browsing thru the SALEX1.SAL file. Hope it's what you're looking for.

Condition creating code may be anything or nothing at all. The $IF statement will be turned into the rejecting (inverse) version of that jump, i.e. E is turned into NE and vice versa. If an $ELSE statment is present it will generate an uncoditional (short) jump around the following code toward the label generated by $ENDIF.

There's a third party book with a section about SALUT,

which is even available at archive.org (registration required to 'borrow').

Here a short write-up of what I remembered when browsing thru the SALEX1.SAL file. Hope it's what you're looking for.

Condition creating code may be anything or nothing at all. The $IF statement will be turned into the rejecting (inverse) version of that jump, i.e. E is turned into NE and vice versa. If an $ELSE statement is present it will generate an unconditional (short) jump around the following code toward the label generated by $ENDIF.

added 990 characters in body
Source Link
Raffzahn
  • 249.5k
  • 23
  • 722
  • 1k

Here'sSecond, while SALUT is not a short writeupdirect down port of what I remembered when browsing thruIBM's HLASM Toolkit, its instructions do reassemble the SALEX1toolkits macros for structured programming.SAL file Looking at the mainframe documentation may give some insight. Hope it's what you're looking forAdditionally there's a real nice introduction written in 1999 (*1).

Here a short writeup of what I remembered when browsing thru the SALEX1.SAL file. Hope it's what you're looking for.


Caveat: I never really used SALUT. I had my own system build with macros (no preprocessor needed), modelled after a mainframe programming system COLUMBUS. Though I studied its workings to see if it would be a viable alternative - which it was not. So this is a short read mostly from memory (*1*2)

SALUT - Structured Assembly Language UTility - is a preprocessor based on direct replacement of Pseudo-Statements by labels and 8086 instructions. It will not rearrange or change any other instruction - although it as well beautifies the source (*2*3). SALUT provides only structures for selection and iteration. Pseudo-statement will only be turned into labels and (one or more) jump instructions.

In addition CXZ, NXCZ may be used in some cases (*3*4)

By nature all 8086 conditional jumps are of SHORT type(*4*5), that is an 8 bit offset allows a target distance of +/-127 locations. To allow structures holding statement sections of more than 127 bytes SALUT may insert a combination of conditional and near jump, but it needs to be told so by adding a parameter named 'LONG' (*5*6)

IF AL=0Dh OR AL=0Ah THEN (handle linefeed) ELSE (char out) (*6*7)

The resulting code shows an important weakness: Condition tests are always generated as basic Jxx statements, not obeying the LONG keyword, making the code not compile if the condition creating statements in total pass 127 bytes (*7*8).

Of course they managed to add even more complexity(*8*9): One can add a COMPLEX keyword to SEARCH which then would enter the loop code only after a following SARTSRCH statement, allowing to jump over some code during first iteration (*9*10).

will show all its glory (*10*11). The virtual disk still has 8 KiB unused space, enough even for complex test scenarios. Have fun.

*1 - The paper was presented at a Share meeting ca. 2000, to convince programmers about the advantage of structured programming. A nice remainder Assembly is anything but a single mindset frozen in the 1960s. Of course that can be seen with other 'primitive' languages as well - like some guys still programming K&R C using a C++20 compiler (GCC 13/MSVC 14) ... yes, guilty as charged :))

*2 - No, my memory is as bad as anyone elses if not way worse, but a short DEBUG session with the version at PCJS did help retrieving the most basic parts.

*2*3 - Beside outputting a new Assembler source it produced also a beautified version of the input file. A feature I really liked and used a lot to turn ugly micro sources into ones formatted as Assembly was intended to be :

*3*4 - That's due the fact that only JNCXZ does not exist as 8086 instruction and SALUT does not provide any replacement code when needed.

*4*5 - It wasn't until the 386 that a NEAR (16 bit) relative distance was introduced.

*5*6 - Kind of an odd choice when Intel already defined that addressing as NEAR.

*6*7 - Yes, stupid example. My only excuse it that it's 4 AM.

*7*8 - Personally I wouldn't consider this an issue as condition creating statements need to be short - except IBM does exactly that in it's only example.

*8*9 - That whole SEARCH construct is waste of time- way too complicated and only good to serve an edge case. SALUT would be way more useful by adding more basic SP constructs. Just imagine how much a basic case/switch statement can improve handling and readability over nested IF mining.

*9*10 - Seriously, I have a hard time to express how much this anoyes me by going against everything structured programming is about. SP is meant to make life simple by adding straight structures, easy be followed in top down fashion with no hidden traps and detours. It is IN NO WAY about providing syntactical sugar for byzantine constructs.

*10*11 - I would think that SALUT is written using CP/M compatible FCB access as produced file length always end up in multiples of 128 bytes.

Here's a short writeup of what I remembered when browsing thru the SALEX1.SAL file. Hope it's what you're looking for.

Caveat: I never really used SALUT. I had my own system build with macros (no preprocessor needed), modelled after a mainframe programming system COLUMBUS. Though I studied its workings to see if it would be a viable alternative - which it was not. So this is a short read mostly from memory (*1)

SALUT - Structured Assembly Language UTility - is a preprocessor based on direct replacement of Pseudo-Statements by labels and 8086 instructions. It will not rearrange or change any other instruction - although it as well beautifies the source (*2). SALUT provides only structures for selection and iteration. Pseudo-statement will only be turned into labels and (one or more) jump instructions.

In addition CXZ, NXCZ may be used in some cases (*3)

By nature all 8086 conditional jumps are of SHORT type(*4), that is an 8 bit offset allows a target distance of +/-127 locations. To allow structures holding statement sections of more than 127 bytes SALUT may insert a combination of conditional and near jump, but it needs to be told so by adding a parameter named 'LONG' (*5)

IF AL=0Dh OR AL=0Ah THEN (handle linefeed) ELSE (char out) (*6)

The resulting code shows an important weakness: Condition tests are always generated as basic Jxx statements, not obeying the LONG keyword, making the code not compile if the condition creating statements in total pass 127 bytes (*7).

Of course they managed to add even more complexity(*8): One can add a COMPLEX keyword to SEARCH which then would enter the loop code only after a following SARTSRCH statement, allowing to jump over some code during first iteration (*9).

will show all its glory (*10). The virtual disk still has 8 KiB unused space, enough even for complex test scenarios. Have fun.

*1 - No, my memory is as bad as anyone elses if not way worse, but a short DEBUG session with the version at PCJS did help retrieving the most basic parts.

*2 - Beside outputting a new Assembler source it produced also a beautified version of the input file. A feature I really liked and used a lot to turn ugly micro sources into ones formatted as Assembly was intended to be :

*3 - That's due the fact that only JNCXZ does not exist as 8086 instruction and SALUT does not provide any replacement code when needed.

*4 - It wasn't until the 386 that a NEAR (16 bit) relative distance was introduced.

*5 - Kind of an odd choice when Intel already defined that addressing as NEAR.

*6 - Yes, stupid example. My only excuse it that it's 4 AM.

*7 - Personally I wouldn't consider this an issue as condition creating statements need to be short - except IBM does exactly that in it's only example.

*8 - That whole SEARCH construct is waste of time- way too complicated and only good to serve an edge case. SALUT would be way more useful by adding more basic SP constructs. Just imagine how much a basic case/switch statement can improve handling and readability over nested IF mining.

*9 - Seriously, I have a hard time to express how much this anoyes me by going against everything structured programming is about. SP is meant to make life simple by adding straight structures, easy be followed in top down fashion with no hidden traps and detours. It is IN NO WAY about providing syntactical sugar for byzantine constructs.

*10 - I would think that SALUT is written using CP/M compatible FCB access as produced file length always end up in multiples of 128 bytes.

Second, while SALUT is not a direct down port of IBM's HLASM Toolkit, its instructions do reassemble the toolkits macros for structured programming. Looking at the mainframe documentation may give some insight. Additionally there's a real nice introduction written in 1999 (*1).

Here a short writeup of what I remembered when browsing thru the SALEX1.SAL file. Hope it's what you're looking for.


Caveat: I never really used SALUT. I had my own system build with macros (no preprocessor needed), modelled after a mainframe programming system COLUMBUS. Though I studied its workings to see if it would be a viable alternative - which it was not. So this is a short read mostly from memory (*2)

SALUT - Structured Assembly Language UTility - is a preprocessor based on direct replacement of Pseudo-Statements by labels and 8086 instructions. It will not rearrange or change any other instruction - although it as well beautifies the source (*3). SALUT provides only structures for selection and iteration. Pseudo-statement will only be turned into labels and (one or more) jump instructions.

In addition CXZ, NXCZ may be used in some cases (*4)

By nature all 8086 conditional jumps are of SHORT type(*5), that is an 8 bit offset allows a target distance of +/-127 locations. To allow structures holding statement sections of more than 127 bytes SALUT may insert a combination of conditional and near jump, but it needs to be told so by adding a parameter named 'LONG' (*6)

IF AL=0Dh OR AL=0Ah THEN (handle linefeed) ELSE (char out) (*7)

The resulting code shows an important weakness: Condition tests are always generated as basic Jxx statements, not obeying the LONG keyword, making the code not compile if the condition creating statements in total pass 127 bytes (*8).

Of course they managed to add even more complexity(*9): One can add a COMPLEX keyword to SEARCH which then would enter the loop code only after a following SARTSRCH statement, allowing to jump over some code during first iteration (*10).

will show all its glory (*11). The virtual disk still has 8 KiB unused space, enough even for complex test scenarios. Have fun.

*1 - The paper was presented at a Share meeting ca. 2000, to convince programmers about the advantage of structured programming. A nice remainder Assembly is anything but a single mindset frozen in the 1960s. Of course that can be seen with other 'primitive' languages as well - like some guys still programming K&R C using a C++20 compiler (GCC 13/MSVC 14) ... yes, guilty as charged :))

*2 - No, my memory is as bad as anyone elses if not way worse, but a short DEBUG session with the version at PCJS did help retrieving the most basic parts.

*3 - Beside outputting a new Assembler source it produced also a beautified version of the input file. A feature I really liked and used a lot to turn ugly micro sources into ones formatted as Assembly was intended to be :

*4 - That's due the fact that only JNCXZ does not exist as 8086 instruction and SALUT does not provide any replacement code when needed.

*5 - It wasn't until the 386 that a NEAR (16 bit) relative distance was introduced.

*6 - Kind of an odd choice when Intel already defined that addressing as NEAR.

*7 - Yes, stupid example. My only excuse it that it's 4 AM.

*8 - Personally I wouldn't consider this an issue as condition creating statements need to be short - except IBM does exactly that in it's only example.

*9 - That whole SEARCH construct is waste of time- way too complicated and only good to serve an edge case. SALUT would be way more useful by adding more basic SP constructs. Just imagine how much a basic case/switch statement can improve handling and readability over nested IF mining.

*10 - Seriously, I have a hard time to express how much this anoyes me by going against everything structured programming is about. SP is meant to make life simple by adding straight structures, easy be followed in top down fashion with no hidden traps and detours. It is IN NO WAY about providing syntactical sugar for byzantine constructs.

*11 - I would think that SALUT is written using CP/M compatible FCB access as produced file length always end up in multiples of 128 bytes.

added 665 characters in body
Source Link
Raffzahn
  • 249.5k
  • 23
  • 722
  • 1k
Loading
COMPLEX and necessary ranting about added.
Source Link
Raffzahn
  • 249.5k
  • 23
  • 722
  • 1k
Loading
added 77 characters in body
Source Link
Raffzahn
  • 249.5k
  • 23
  • 722
  • 1k
Loading
added 581 characters in body
Source Link
Raffzahn
  • 249.5k
  • 23
  • 722
  • 1k
Loading
added 90 characters in body
Source Link
Raffzahn
  • 249.5k
  • 23
  • 722
  • 1k
Loading
Source Link
Raffzahn
  • 249.5k
  • 23
  • 722
  • 1k
Loading