4 ms·
It is somewhat striking how high level the 360 assembler is. It's not that difficult to read the code snippet below. So there are assembler instructions (not m
by nn3 6y ago
It is somewhat striking how high level the 360 assembler is. It's not that difficult to read the code snippet below.
So there are assembler instructions (not macros I believe) that are equivalent to "strcmp", "strcpy". Well I guess they're more sub routine calls for micro code.
Equivalent C code probably wouldn't be that much shorter, while modern assembler languages would expand to much more and harder to read code. Even x86 which has strcmp/strcpy instructions requires much more boilerplate, and also they're generally not used anymore because they're too slow.
Now of course with all the gotos (jumps) it is still quite spaghetti code. But if the assembler had some structured programming features (and maybe types) it probably wouldn't be that bad.
Of course it helps that everything was much simpler then.
(sorry for the screwy formatting)
SEARCH LA R9,LENGTH LIMIT FOR BXLE
LA R8,12 INCREMENT FOR BXLE
LA R1,SMLIST POINT TO STATE PLIST
MVC 8(8,R1),8(R7) MOVE IN FILENAME
MVI 24(R1),C'P' SEARCH PERMANENT DISK FIRST
LOOP2 LA R2,TYPES SET BXLE INDEX AT 1ST FILETYPE
LOOP MVC 16(8,R1),0(R2) CHECK FOR VARIOUS FILE TYPES
SVC X'CA' CALL STATE
DC AL4(ERH) GO CHECK R15 ERROR CODES
BC 15,8(0,R2) RETURN CODE WAS 0. FILE FOUND, SO BRANCHERH
C R15,AONE WAS RETURNED ERROR CODE A 1?
BE BIX IF SO, FILE NOT FOUND. TRY AG
LA R9,4 STATE ERROR CODE OF 4
BC 15,CLOSUP