Binary strings: Difference between revisions

m
Line 923:
\ 1. String creation and destruction (when needed and if there's no garbage collection or similar mechanism)
 
\ RAW Forth can manually create a binary string with the C, operator.
\ C, takes a byte off the stack and writes it into the next available memory address
\ then increments the Forth internal memory pointer by 1 byte.
\ 'binary_string' drops it's data address on the stack. Nothing more. (ie: pointer to the string)
 
HEX ok
Line 933 ⟶ 934:
 
\ test what we created using the DUMP utility
 
binary_string count dump
25EC:7365 01 02 03 04 05 0A 0B 0C FF 04 44 55 4D 50 00 20 ..........DUMP.
ok
 
 
\ Alternatively we can create static string variables using our constructor ok
string: buffer1 ok
string: buffer2 ok
Line 991 ⟶ 993:
string1 writestr Now is the time for all good men to come to the aid ok
buffer1 writestr Now is the time for all good men to come to the aid ok
 
 
 
Anonymous user