Last active
April 23, 2026 11:26
-
-
Save heatblazer/2b91839edc7845fc742405ceb8cb8e4e to your computer and use it in GitHub Desktop.
SO-79930597
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original text: (dat.txt) | |
| A competent translation of the previous pseudocode to real assembly is shown | |
| in Listing 8.2. (This is the version that links via gcc rather than ld. Open it and | |
| build it in SASM.) Read through it and see if you can follow the translation from | |
| the pseudocode, knowing what you already know about assembly language. | |
| The code shown will work but is not “finished” in any real sense. It’s a “first cut” | |
| for real code in the successive refinement process. It needs some hard thinking | |
| about how good and how complete a solution it is to the original problem. | |
| Transformed: (out.txt) viewed in emacs | |
| A COMPETENT TR\0NSL\0TION OF THE PREVIOUS PSEUDOCODE TO RE\0L \0SSEMBLY IS SHOWN | |
| IN LISTING 8.2. (THIS IS THE VERSION TH\0T LINKS VI\0 GCC R\0THER TH\0N LD. OPEN IT \0ND | |
| BUILD IT IN SASM.) RE\0D THROUGH IT \0ND SEE IF YOU C\0N FOLLOW THE TR\0NSL\0TION FROM | |
| THE PSEUDOCODE, KNOWING WH\0T YOU \0LRE\0DY KNOW \0BOUT \0SSEMBLY L\0NGU\0GE. | |
| THE CODE SHOWN WILL WORK BUT IS NOT �\0�FINISHED�\0� IN \0NY RE\0L SENSE. IT�\0�S \0 �\0�FIRST CUT�\0� | |
| FOR RE\0L CODE IN THE SUCCESSIVE REFINEMENT PROCESS. IT NEEDS SOME H\0RD THINKING | |
| \0BOUT HOW GOOD \0ND HOW COMPLETE \0 SOLUTION IT IS TO THE ORIGIN\0L PROBLEM. | |
| SSIVE REFINEMENT PROCESS. IT NEEDS SOME H\0RD THINKING | |
| \0BOUT HOW GOOD \0ND HOW | |
| Transformed: (out.txt) Viewed in cat | |
| A COMPETENT TRANSLATION OF THE PREVIOUS PSEUDOCODE TO REAL ASSEMBLY IS SHOWN | |
| IN LISTING 8.2. (THIS IS THE VERSION THAT LINKS VIA GCC RATHER THAN LD. OPEN IT AND | |
| BUILD IT IN SASM.) READ THROUGH IT AND SEE IF YOU CAN FOLLOW THE TRANSLATION FROM | |
| THE PSEUDOCODE, KNOWING WHAT YOU ALREADY KNOW ABOUT ASSEMBLY LANGUAGE. | |
| THE CODE SHOWN WILL WORK BUT IS NOT “FINISHED” IN ANY REAL SENSE. IT’S A “FIRST CUT” | |
| FOR REAL CODE IN THE SUCCESSIVE REFINEMENT PROCESS. IT NEEDS SOME HARD THINKING | |
| ABOUT HOW GOOD AND HOW COMPLETE A SOLUTION IT IS TO THE ORIGINAL PROBLEM. | |
| SSIVE REFINEMENT PROCESS. IT NEEDS SOME HRD THINKING | |
| BOUT HOW GOOD ND HOW | |
| GDB: | |
| x/256cb &upperlut (OLD) | |
| 32 ' ' 33 '!' 34 '"' 35 '#' 36 '$' 37 '%' 38 '&' 39 '\'' | |
| 0x4040e8: 40 '(' 41 ')' 42 '*' 43 '+' 44 ',' 45 '-' 46 '.' 47 '/' | |
| 0x4040f0: 48 '0' 49 '1' 50 '2' 51 '3' 52 '4' 53 '5' 54 '6' 55 '7' | |
| 0x4040f8: 56 '8' 57 '9' 58 ':' 59 ';' 60 '<' 61 '=' 62 '>' 63 '?' | |
| 0x404100: 64 '@' 65 'A' 66 'B' 67 'C' 68 'D' 69 'E' 70 'F' 71 'G' | |
| 0x404108: 72 'H' 73 'I' 74 'J' 75 'K' 76 'L' 77 'M' 78 'N' 79 'O' | |
| 0x404110: 80 'P' 81 'Q' 82 'R' 83 'S' 84 'T' 85 'U' 86 'V' 87 'W' | |
| 0x404118: 88 'X' 89 'Y' 90 'Z' 0 '\000' 0 '\000' 0 '\000' 0 '\000' 0 '\000' | |
| 0x404120: 0 '\000' 0 '\000' 66 'B' 67 'C' 68 'D' 69 'E' 70 'F' 71 'G' | |
| 0x404128: 72 'H' 73 'I' 74 'J' 75 'K' 76 'L' 77 'M' 78 'N' 79 'O' | |
| 0x404130: 80 'P' 81 'Q' 82 'R' 83 'S' 84 'T' 85 'U' 86 'V' 87 'W' | |
| 0x404138: 88 'X' 89 'Y' 90 'Z' 0 '\000' | |
| GDB: | |
| x/256cb &upperlut (NEW) | |
| 0x4040e0: 32 ' ' 33 '!' 34 '"' 35 '#' 36 '$' 37 '%' 38 '&' 39 '\'' | |
| 0x4040e8: 40 '(' 41 ')' 42 '*' 43 '+' 44 ',' 45 '-' 46 '.' 47 '/' | |
| 0x4040f0: 48 '0' 49 '1' 50 '2' 51 '3' 52 '4' 53 '5' 54 '6' 55 '7' | |
| 0x4040f8: 56 '8' 57 '9' 58 ':' 59 ';' 60 '<' 61 '=' 62 '>' 63 '?' | |
| 0x404100: 64 '@' 65 'A' 66 'B' 67 'C' 68 'D' 69 'E' 70 'F' 71 'G' | |
| 0x404108: 72 'H' 73 'I' 74 'J' 75 'K' 76 'L' 77 'M' 78 'N' 79 'O' | |
| 0x404110: 80 'P' 81 'Q' 82 'R' 83 'S' 84 'T' 85 'U' 86 'V' 87 'W' | |
| 0x404118: 88 'X' 89 'Y' 90 'Z' 91 '[' 92 '\\' 93 ']' 94 '^' 95 '_' | |
| 0x404120: 96 '`' 65 'A' 98 'b' 99 'c' 100 'd' 101 'e' 102 'f' 103 'g' | |
| 0x404128: 104 'h' 105 'i' 106 'j' 107 'k' 108 'l' 109 'm' 110 'n' 111 'o' | |
| 0x404130: 112 'p' 113 'q' 114 'r' 115 's' 116 't' 117 'u' 118 'v' 119 'w' | |
| 0x404138: 120 'x' 121 'y' 122 'z' 123 '{' 124 '|' 125 '}' 126 '~' 127 '\177' | |
| 0x404140: -128 '\200' -127 '\201' | |
| (gdb) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment