MCPcopy Create free account
hub / github.com/dobin/SuperMega / convert_asm_db_to_bytes

Function convert_asm_db_to_bytes

phases/asmtextparser.py:146–158  ·  view source on GitHub ↗
(line: str)

Source from the content-addressed store, hash-verified

144
145
146def convert_asm_db_to_bytes(line: str) -> bytes:
147 value = b''
148 parts = line.split()
149 for part in parts:
150 if part.startswith('\''):
151 value += str.encode(part.split('\'')[1])
152 elif part.endswith('H') or part.endswith('H,'):
153 hex = part.split('H')[0]
154 if len(hex) == 3:
155 # 09cH,
156 hex = hex[1:]
157 value += bytes.fromhex(hex)
158 return value
159
160
161def bytes_to_asm_db(byte_data: bytes) -> bytes:

Callers 1

parse_asm_text_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected