(创建页面,内容为“== Tricks == * Multiple digits can be saved in the same memory cell; each cell can contain 2 or 3 digits. Set a digit with `dst`; get a digit with `dgt`. To eff…”)
 
→‎Tricks
第1行: 第1行:
 
== Tricks ==
 
== Tricks ==
  
 +
=== Memory Chip ===
 
* Multiple digits can be saved in the same memory cell; each cell can contain 2 or 3 digits.
 
* Multiple digits can be saved in the same memory cell; each cell can contain 2 or 3 digits.
 
   Set a digit with `dst`; get a digit with `dgt`.
 
   Set a digit with `dst`; get a digit with `dgt`.
第10行: 第11行:
 
   So you don't need to say `tgt acc 13; +sub 13`
 
   So you don't need to say `tgt acc 13; +sub 13`
  
 +
=== Processor Chip ===
 
* If the range of *acc* is limited, then the extra range can be used to store a bit.
 
* If the range of *acc* is limited, then the extra range can be used to store a bit.
 
   Say if the value is 0 ~ 200, then we can `sub 400` from it to use -400 ~ -200 to represent the bit = 1, and the original range to represent bit = 0.
 
   Say if the value is 0 ~ 200, then we can `sub 400` from it to use -400 ~ -200 to represent the bit = 1, and the original range to represent bit = 0.
 +
 +
* An Xbus can be shared by multiple writer; however you should only have 1 reader.
 +
 +
* Sometimes `jmp L` can be omitted by carefully placing +/- on the statements below.
 +
  If you have another test statement, though, this becomes harder.

2023年6月19日 (一) 02:21的版本

Tricks

Memory Chip

  • Multiple digits can be saved in the same memory cell; each cell can contain 2 or 3 digits.
 Set a digit with `dst`; get a digit with `dgt`.
 To effectively extract the digits, ideally this should be done in a big chip, by putting the data into *dat* and repeatedly move it into *acc*.
  • Memory chip is also a great accumulator
  • Memory chip's address port can handle values which are bigger than the max address - it'll wrap around.
 So you don't need to say `tgt acc 13; +sub 13`

Processor Chip

  • If the range of *acc* is limited, then the extra range can be used to store a bit.
 Say if the value is 0 ~ 200, then we can `sub 400` from it to use -400 ~ -200 to represent the bit = 1, and the original range to represent bit = 0.
  • An Xbus can be shared by multiple writer; however you should only have 1 reader.
  • Sometimes `jmp L` can be omitted by carefully placing +/- on the statements below.
 If you have another test statement, though, this becomes harder.