Rizin
unix-like reverse engineering framework and cli tools
z80asm.c File Reference
#include "z80asm.h"
#include <rz_util.h>
#include "expressions.c"

Go to the source code of this file.

Macros

#define RZ_API_I
 
#define write_one_byte(x, y)   obuf[obuflen++] = x
 
#define wrtb(x)   obuf[obuflen++] = x
 
#define DE   2
 
#define AF   3
 
#define A   8
 
#define C   1
 
#define HL   2
 
#define ldBC   1
 
#define ldDE   2
 
#define ldHL   3
 
#define ldSP   4
 
#define ldIX   5
 
#define ldIY   6
 
#define ldB   7
 
#define ldC   8
 
#define ldD   9
 
#define ldE   10
 
#define ldH   11
 
#define ldL   12
 
#define ld_HL   13
 
#define ldA   14
 
#define ldI   15
 
#define ldR   16
 
#define ld_BC   17
 
#define ld_DE   18
 
#define ld_IX   19
 
#define ld_IY   20
 
#define ld_NN   21
 
#define addHL   15
 
#define ld_nnHL   5
 
#define ld_nnA   6
 
#define A_N   7
 
#define A_I   9
 
#define A_R   10
 
#define A_NN   11
 
#define _NN   1
 
#define SPNN   0
 
#define SPHL   1
 

Functions

static void printerr (int error, const char *fmt,...)
 
static const char * delspc (const char *ptr)
 
static void rd_comma (const char **p)
 
static int has_argument (const char **p)
 
static void skipword (const char **pos, char delimiter)
 
static int indx (const char **ptr, const char **list, int error, const char **expr)
 
static int readcommand (const char **p)
 
static void readlabel (const char **p, int store)
 
static int compute_ref (struct reference *ref, int allow_invalid)
 
static int rd_word (const char **p, char delimiter)
 
static int rd_byte (const char **p, char delimiter)
 
static int rd_ex1 (const char **p)
 
static int rd_in (const char **p)
 
static int rd_out (const char **p)
 
static int rd_nnc (const char **p)
 
static int rd_c (const char **p)
 
static int rd_a_hl (const char **p)
 
static int rd_ld (const char **p)
 
static int rd_jp (const char **p)
 
static int rd_jr (const char **p)
 
static int rd_a (const char **p)
 
static int rd_stack (const char **p)
 
static int rd_r_add (const char **p)
 
static int rd_rr_ (const char **p)
 
static int rd_rrxx (const char **p)
 
static int rd_r (const char **p)
 
static int rd_r_ (const char **p)
 
static int rd_0_7 (const char **p)
 
static int rd_cc (const char **p)
 
static int rd_r_rr (const char **p)
 
static int rd_hl (const char **p)
 
static int rd_hlx (const char **p)
 
static int rd_af_ (const char **p)
 
static int rd_0_2 (const char **p)
 
static int rd_ld_hl (const char **p)
 
static int rd_ld_nn (const char **p)
 
static int rd_lda (const char **p)
 
static int rd_ldbcdehla (const char **p)
 
static int rd_nn_nn (const char **p)
 
static int rd_sp (const char **p)
 
static int assemble (const char *str, unsigned char *_obuf)
 
RZ_API_I int z80asm (unsigned char *outbuf, const char *s)
 

Variables

static unsigned char * obuf
 
static int obuflen = 0
 
static const char * mnemonics []
 
static int addr = 0
 
static int file
 
static int writebyte
 
static const char * readbyte
 
static const char * readword
 
static const char * indexjmp
 
static const char * bitsetres
 
static int indexed
 
static int verbose = 0
 
static int comma
 
static int baseaddr
 
static char mem_delimiter
 
static char * z80buffer = NULL
 
static int define_macro = 0
 
static int sp
 
static struct stack stack [MAX_INCLUDE]
 

Macro Definition Documentation

◆ _NN

#define _NN   1

◆ A

#define A   8

◆ A_I

#define A_I   9

◆ A_N

#define A_N   7

◆ A_NN

#define A_NN   11

◆ A_R

#define A_R   10

◆ addHL

#define addHL   15

◆ AF

#define AF   3

◆ C

#define C   1

◆ DE

#define DE   2

◆ HL

#define HL   2

◆ ld_BC

#define ld_BC   17

◆ ld_DE

#define ld_DE   18

◆ ld_HL

#define ld_HL   13

◆ ld_IX

#define ld_IX   19

◆ ld_IY

#define ld_IY   20

◆ ld_NN

#define ld_NN   21

◆ ld_nnA

#define ld_nnA   6

◆ ld_nnHL

#define ld_nnHL   5

◆ ldA

#define ldA   14

◆ ldB

#define ldB   7

◆ ldBC

#define ldBC   1

◆ ldC

#define ldC   8

◆ ldD

#define ldD   9

◆ ldDE

#define ldDE   2

◆ ldE

#define ldE   10

◆ ldH

#define ldH   11

◆ ldHL

#define ldHL   3

◆ ldI

#define ldI   15

◆ ldIX

#define ldIX   5

◆ ldIY

#define ldIY   6

◆ ldL

#define ldL   12

◆ ldR

#define ldR   16

◆ ldSP

#define ldSP   4

◆ RZ_API_I

#define RZ_API_I

Definition at line 28 of file z80asm.c.

◆ SPHL

#define SPHL   1

◆ SPNN

#define SPNN   0

◆ write_one_byte

#define write_one_byte (   x,
 
)    obuf[obuflen++] = x

Definition at line 38 of file z80asm.c.

◆ wrtb

#define wrtb (   x)    obuf[obuflen++] = x

Definition at line 39 of file z80asm.c.

Function Documentation

◆ assemble()

static int assemble ( const char *  str,
unsigned char *  _obuf 
)
static

Definition at line 784 of file z80asm.c.

784  {
785  const char *ptr;
786  char *bufptr;
787  int r, s; /* registers */
788 
789  obuflen = 0;
790  obuf = _obuf;
791  int cmd, cont = 1;
792  // XXX: must free
793  z80buffer = strdup (str);
794  if (!cont) {
795  return obuflen;
796  }
797  // if (havelist)
798  // fprintf (listfile, "%04x", addr);
799  for (bufptr = z80buffer; (bufptr = strchr (bufptr, '\n'));) {
800  *bufptr = ' ';
801  }
802  for (bufptr = z80buffer; (bufptr = strchr (bufptr, '\r'));) {
803  *bufptr = ' ';
804  }
805  ptr = z80buffer;
806  // lastlabel = NULL;
807  baseaddr = addr;
808  ++stack[sp].line;
809  ptr = delspc (ptr);
810  if (!*ptr) {
811  return obuflen;
812  }
813  if (!define_macro) {
814  readlabel (&ptr, 1);
815  } else {
816  readlabel (&ptr, 0);
817  }
818  ptr = delspc (ptr);
819  if (!*ptr) {
820  return obuflen;
821  }
822  comma = 0;
823  indexed = 0;
824  indexjmp = 0;
825  writebyte = 0;
826  readbyte = 0;
827  readword = 0;
828  cmd = readcommand (&ptr) - 1;
829  int i, have_quote;
830  switch (cmd) {
831  case Z80_ADC:
832  if (!(r = rd_a_hl (&ptr))) {
833  break;
834  }
835  if (r == HL) {
836  if (!(r = rd_rr_(&ptr))) {
837  break;
838  }
839  wrtb (0xED);
840  r--;
841  wrtb (0x4A + 0x10 * r);
842  break;
843  }
844  if (!(r = rd_r (&ptr))) {
845  break;
846  }
847  r--;
848  wrtb (0x88 + r);
849  break;
850  case Z80_ADD:
851  if (!(r = rd_r_add (&ptr))) {
852  break;
853  }
854  if (r == addHL) {
855  if (!(r = rd_rrxx (&ptr))) {
856  break;
857  }
858  r--;
859  wrtb (0x09 + 0x10 * r); /* ADD HL/IX/IY, qq */
860  break;
861  }
862  if (has_argument (&ptr)) {
863  if (r != A) {
864  RZ_LOG_ERROR("assembler: z80: parse error before: %s\n", ptr);
865  break;
866  }
867  if (!(r = rd_r (&ptr))) {
868  break;
869  }
870  r--;
871  wrtb (0x80 + r); /* ADD A,r */
872  break;
873  }
874  r--;
875  wrtb (0x80 + r); /* ADD r */
876  break;
877  case Z80_AND:
878  if (!(r = rd_r (&ptr))) {
879  break;
880  }
881  r--;
882  wrtb (0xA0 + r);
883  break;
884  case Z80_BIT:
885  if (!rd_0_7 (&ptr)) {
886  break;
887  }
888  rd_comma (&ptr);
889  if (!(r = rd_r_(&ptr))) {
890  break;
891  }
892  wrtb (0xCB);
893  wrtb (0x40 + (r - 1));
894  break;
895  case Z80_CALL:
896  if ((r = rd_cc (&ptr))) {
897  r--;
898  wrtb (0xC4 + 8 * r);
899  rd_comma (&ptr);
900  } else {
901  wrtb (0xCD);
902  }
903  break;
904  case Z80_CCF:
905  wrtb (0x3F);
906  break;
907  case Z80_CP:
908  if (!(r = rd_r (&ptr))) {
909  break;
910  }
911  r--;
912  wrtb (0xB8 + r);
913  break;
914  case Z80_CPD:
915  wrtb (0xED);
916  wrtb (0xA9);
917  break;
918  case Z80_CPDR:
919  wrtb (0xED);
920  wrtb (0xB9);
921  break;
922  case Z80_CPI:
923  wrtb (0xED);
924  wrtb (0xA1);
925  break;
926  case Z80_CPIR:
927  wrtb (0xED);
928  wrtb (0xB1);
929  break;
930  case Z80_CPL:
931  wrtb (0x2F);
932  break;
933  case Z80_DAA:
934  wrtb (0x27);
935  break;
936  case Z80_DEC:
937  if (!(r = rd_r_rr (&ptr))) {
938  break;
939  }
940  if (r < 0) {
941  r--;
942  wrtb (0x05 - 8 * r);
943  break;
944  }
945  r--;
946  wrtb (0x0B + 0x10 * r);
947  break;
948  case Z80_DI:
949  wrtb (0xF3);
950  break;
951  case Z80_DJNZ:
952  wrtb (0x10);
953  // rd_wrt_jr (&ptr, '\0');
954  break;
955  case Z80_EI:
956  wrtb (0xFB);
957  break;
958  case Z80_EX:
959  if (!(r = rd_ex1 (&ptr))) {
960  break;
961  }
962  switch (r) {
963  case DE:
964  if (!rd_hl (&ptr)) {
965  break;
966  }
967  wrtb (0xEB);
968  break;
969  case AF:
970  if (!rd_af_(&ptr)) {
971  break;
972  }
973  wrtb (0x08);
974  break;
975  default:
976  if (!rd_hlx (&ptr)) {
977  break;
978  }
979  wrtb (0xE3);
980  }
981  break;
982  case Z80_EXX:
983  wrtb (0xD9);
984  break;
985  case Z80_HALT:
986  wrtb (0x76);
987  break;
988  case Z80_IM:
989  if (!(r = rd_0_2 (&ptr))) {
990  break;
991  }
992  wrtb (0xED);
993  r--;
994  wrtb (0x46 + 8 * r);
995  break;
996  case Z80_IN:
997  if (!(r = rd_in (&ptr))) {
998  break;
999  }
1000  if (r == A) {
1001  if (!(r = rd_nnc (&ptr))) {
1002  break;
1003  }
1004  if (r == C) {
1005  wrtb (0xED);
1006  wrtb (0x40 + 8 * (A - 1));
1007  break;
1008  }
1009  wrtb (0xDB);
1010  break;
1011  }
1012  if (!rd_c (&ptr)) {
1013  break;
1014  }
1015  wrtb (0xED);
1016  r--;
1017  wrtb (0x40 + 8 * r);
1018  break;
1019  case Z80_INC:
1020  if (!(r = rd_r_rr (&ptr))) {
1021  break;
1022  }
1023  if (r < 0) {
1024  r++;
1025  wrtb (0x04 - 8 * r);
1026  break;
1027  }
1028  r--;
1029  wrtb (0x03 + 0x10 * r);
1030  break;
1031  case Z80_IND:
1032  wrtb (0xED);
1033  wrtb (0xAA);
1034  break;
1035  case Z80_INDR:
1036  wrtb (0xED);
1037  wrtb (0xBA);
1038  break;
1039  case Z80_INI:
1040  wrtb (0xED);
1041  wrtb (0xA2);
1042  break;
1043  case Z80_INIR:
1044  wrtb (0xED);
1045  wrtb (0xB2);
1046  break;
1047  case Z80_JP:
1048  r = rd_jp (&ptr);
1049  if (r < 0) {
1050  wrtb (0xE9);
1051  break;
1052  }
1053  if (r) {
1054  r--;
1055  wrtb (0xC2 + 8 * r);
1056  rd_comma (&ptr);
1057  } else {
1058  wrtb (0xC3);
1059  }
1060  break;
1061  case Z80_JR:
1062  r = rd_jr (&ptr);
1063  if (r) {
1064  rd_comma (&ptr);
1065  }
1066  wrtb (0x18 + 8 * r);
1067  break;
1068  case Z80_LD:
1069  if (!(r = rd_ld (&ptr))) {
1070  break;
1071  }
1072  switch (r) {
1073  case ld_BC:
1074  case ld_DE:
1075  if (!rd_a (&ptr)) {
1076  break;
1077  }
1078  wrtb (0x02 + 0x10 * (r == ld_DE ? 1 : 0));
1079  break;
1080  case ld_HL:
1081  r = rd_ld_hl (&ptr) - 1;
1082  wrtb (0x70 + r);
1083  break;
1084  case ld_NN:
1085  if (!(r = rd_ld_nn (&ptr))) {
1086  break;
1087  }
1088  if (r == ld_nnA || r == ld_nnHL) {
1089  wrtb (0x22 + 0x10 * (r == ld_nnA ? 1 : 0));
1090  break;
1091  }
1092  wrtb (0xED);
1093  wrtb (0x43 + 0x10 * --r);
1094  break;
1095  case ldA:
1096  if (!(r = rd_lda (&ptr))) {
1097  break;
1098  }
1099  if (r == A_NN) {
1100  wrtb (0x3A);
1101  break;
1102  }
1103  if (r == A_I || r == A_R) {
1104  wrtb (0xED);
1105  wrtb (0x57 + 8 * (r == A_R ? 1 : 0));
1106  break;
1107  }
1108  if (r == A_N) {
1109  char n = rz_num_math (NULL, readbyte);
1110  wrtb (0x3E);
1111  wrtb (n);
1112  break;
1113  }
1114  if (r < 0) {
1115  r++;
1116  wrtb (0x0A - 0x10 * r);
1117  break;
1118  }
1119  wrtb (0x78 + --r);
1120  break;
1121  case ldB:
1122  case ldC:
1123  case ldD:
1124  case ldE:
1125  case ldH:
1126  case ldL:
1127  if (!(s = rd_ldbcdehla (&ptr))) {
1128  break;
1129  }
1130  if (s == 7) {
1131  char n = rz_num_math(NULL, readbyte);
1132  wrtb (0x08 * (r - 7) + 0x6);
1133  wrtb (n);
1134  } else {
1135  wrtb (0x40 + 0x08 * (r -7) + (s - 1));
1136  }
1137  break;
1138  case ldBC:
1139  case ldDE:
1140  s = rd_nn_nn (&ptr);
1141  if (s == _NN) {
1142  wrtb (0xED);
1143  wrtb (0x4B + 0x10 * (r == ldDE ? 1 : 0));
1144  break;
1145  }
1146  wrtb (0x01 + (r == ldDE ? 1 : 0) * 0x10);
1147  break;
1148  case ldHL:
1149  r = rd_nn_nn (&ptr);
1150  wrtb (0x21 + (r == _NN ? 1 : 0) * 9);
1151  break;
1152  case ldI:
1153  case ldR:
1154  if (!rd_a (&ptr)) {
1155  break;
1156  }
1157  wrtb (0xED);
1158  wrtb (0x47 + 0x08 * (r == ldR ? 1 : 0));
1159  break;
1160  case ldSP:
1161  r = rd_sp (&ptr);
1162  if (r == SPHL) {
1163  wrtb (0xF9);
1164  break;
1165  }
1166  if (r == SPNN) {
1167  wrtb (0x31);
1168  break;
1169  }
1170  wrtb (0xED);
1171  wrtb (0x7B);
1172  break;
1173  }
1174  break;
1175  case Z80_LDD:
1176  wrtb (0xED);
1177  wrtb (0xA8);
1178  break;
1179  case Z80_LDDR:
1180  wrtb (0xED);
1181  wrtb (0xB8);
1182  break;
1183  case Z80_LDI:
1184  wrtb (0xED);
1185  wrtb (0xA0);
1186  break;
1187  case Z80_LDIR:
1188  wrtb (0xED);
1189  wrtb (0xB0);
1190  break;
1191  case Z80_NEG:
1192  wrtb (0xED);
1193  wrtb (0x44);
1194  break;
1195  case Z80_NOP:
1196  wrtb (0x00);
1197  break;
1198  case Z80_OR:
1199  if (!(r = rd_r (&ptr))) {
1200  break;
1201  }
1202  r--;
1203  wrtb (0xB0 + r);
1204  break;
1205  case Z80_OTDR:
1206  wrtb (0xED);
1207  wrtb (0xBB);
1208  break;
1209  case Z80_OTIR:
1210  wrtb (0xED);
1211  wrtb (0xB3);
1212  break;
1213  case Z80_OUT:
1214  if (!(r = rd_nnc (&ptr))) {
1215  break;
1216  }
1217  if (r == C) {
1218  if (!(r = rd_out (&ptr))) {
1219  break;
1220  }
1221  wrtb (0xED);
1222  r--;
1223  wrtb (0x41 + 8 * r);
1224  break;
1225  }
1226  if (!rd_a (&ptr)) {
1227  break;
1228  }
1229  wrtb (0xD3);
1230  break;
1231  case Z80_OUTD:
1232  wrtb (0xED);
1233  wrtb (0xAB);
1234  break;
1235  case Z80_OUTI:
1236  wrtb (0xED);
1237  wrtb (0xA3);
1238  break;
1239  case Z80_POP:
1240  if (!(r = rd_stack (&ptr))) {
1241  break;
1242  }
1243  r--;
1244  wrtb (0xC1 + 0x10 * r);
1245  break;
1246  case Z80_PUSH:
1247  if (!(r = rd_stack (&ptr))) {
1248  break;
1249  }
1250  r--;
1251  wrtb (0xC5 + 0x10 * r);
1252  break;
1253  case Z80_RES:
1254  if (!rd_0_7 (&ptr)) {
1255  break;
1256  }
1257  rd_comma (&ptr);
1258  if (!(r = rd_r_(&ptr))) {
1259  break;
1260  }
1261  wrtb (0xCB);
1262  r--;
1263  wrtb (0x80 + r);
1264  break;
1265  case Z80_RET:
1266  if (!(r = rd_cc (&ptr))) {
1267  wrtb (0xC9);
1268  break;
1269  }
1270  r--;
1271  wrtb (0xC0 + 8 * r);
1272  break;
1273  case Z80_RETI:
1274  wrtb (0xED);
1275  wrtb (0x4D);
1276  break;
1277  case Z80_RETN:
1278  wrtb (0xED);
1279  wrtb (0x45);
1280  break;
1281  case Z80_RL:
1282  if (!(r = rd_r_(&ptr))) {
1283  break;
1284  }
1285  wrtb (0xCB);
1286  r--;
1287  wrtb (0x10 + r);
1288  break;
1289  case Z80_RLA:
1290  wrtb (0x17);
1291  break;
1292  case Z80_RLC:
1293  if (!(r = rd_r_(&ptr))) {
1294  break;
1295  }
1296  wrtb (0xCB);
1297  r--;
1298  wrtb (0x00 + r);
1299  break;
1300  case Z80_RLCA:
1301  wrtb (0x07);
1302  break;
1303  case Z80_RLD:
1304  wrtb (0xED);
1305  wrtb (0x6F);
1306  break;
1307  case Z80_RR:
1308  if (!(r = rd_r_(&ptr))) {
1309  break;
1310  }
1311  wrtb (0xCB);
1312  r--;
1313  wrtb (0x18 + r);
1314  break;
1315  case Z80_RRA:
1316  wrtb (0x1F);
1317  break;
1318  case Z80_RRC:
1319  if (!(r = rd_r_(&ptr))) {
1320  break;
1321  }
1322  wrtb (0xCB);
1323  r--;
1324  wrtb (0x08 + r);
1325  break;
1326  case Z80_RRCA:
1327  wrtb (0x0F);
1328  break;
1329  case Z80_RRD:
1330  wrtb (0xED);
1331  wrtb (0x67);
1332  break;
1333  case Z80_RST:
1334  ptr = "";
1335  break;
1336  case Z80_SBC:
1337  if (!(r = rd_a_hl (&ptr))) {
1338  break;
1339  }
1340  if (r == HL) {
1341  if (!(r = rd_rr_(&ptr))) {
1342  break;
1343  }
1344  wrtb (0xED);
1345  r--;
1346  wrtb (0x42 + 0x10 * r);
1347  break;
1348  }
1349  if (!(r = rd_r (&ptr))) {
1350  break;
1351  }
1352  r--;
1353  wrtb (0x98 + r);
1354  break;
1355  case Z80_SCF:
1356  wrtb (0x37);
1357  break;
1358  case Z80_SET:
1359  if (!rd_0_7 (&ptr)) {
1360  break;
1361  }
1362  rd_comma (&ptr);
1363  if (!(r = rd_r_(&ptr))) {
1364  break;
1365  }
1366  wrtb (0xCB);
1367  r--;
1368  wrtb (0xC0 + r);
1369  break;
1370  case Z80_SLA:
1371  if (!(r = rd_r_(&ptr))) {
1372  break;
1373  }
1374  wrtb (0xCB);
1375  r--;
1376  wrtb (0x20 + r);
1377  break;
1378  case Z80_SLI:
1379  if (!(r = rd_r_(&ptr))) {
1380  break;
1381  }
1382  wrtb (0xCB);
1383  r--;
1384  wrtb (0x30 + r);
1385  break;
1386  case Z80_SRA:
1387  if (!(r = rd_r_(&ptr))) {
1388  break;
1389  }
1390  wrtb (0xCB);
1391  r--;
1392  wrtb (0x28 + r);
1393  break;
1394  case Z80_SRL:
1395  if (!(r = rd_r_(&ptr))) {
1396  break;
1397  }
1398  wrtb (0xCB);
1399  r--;
1400  wrtb (0x38 + r);
1401  break;
1402  case Z80_SUB:
1403  if (!(r = rd_r (&ptr))) {
1404  break;
1405  }
1406  if (has_argument (&ptr)) { /* SUB A,r ? */
1407  if (r != A) {
1408  RZ_LOG_ERROR("assembler: z80: parse error before: %s\n", ptr);
1409  break;
1410  }
1411  if (!(r = rd_r (&ptr))) {
1412  break;
1413  }
1414  }
1415  r--;
1416  wrtb (0x90 + r);
1417  break;
1418  case Z80_XOR:
1419  if (!(r = rd_r (&ptr))) {
1420  break;
1421  }
1422  r--;
1423  wrtb (0xA8 + r);
1424  break;
1425  case Z80_DEFB:
1426  case Z80_DB:
1427  case Z80_DEFM:
1428  case Z80_DM:
1429  ptr = delspc (ptr);
1430  while (1) {
1431  have_quote = (*ptr == '"' || *ptr == '\'');
1432  if (have_quote) {
1433  /* Read string. */
1434  int quote = *ptr;
1435  ++ptr;
1436  while (*ptr != quote) {
1437  write_one_byte (rd_character (&ptr, NULL, 1), 0);
1438  if (*ptr == 0) {
1439  RZ_LOG_ERROR("assembler: z80: end of line in quoted string\n");
1440  break;
1441  }
1442  }
1443  ++ptr;
1444  } else {
1445  /* Read expression. */
1446  skipword (&ptr, ',');
1447  }
1448  ptr = delspc (ptr);
1449  if (*ptr == ',') {
1450  ++ptr;
1451  continue;
1452  }
1453  if (*ptr != 0) {
1454  RZ_LOG_ERROR("assembler: z80: junk in byte definition: %s\n", ptr);
1455  }
1456  break;
1457  }
1458  break;
1459  case Z80_DEFW:
1460  case Z80_DW:
1461  if (!rd_word (&ptr, ',')) {
1462  RZ_LOG_ERROR("assembler: z80: No data for word definition\n");
1463  break;
1464  }
1465  while (1) {
1466  ptr = delspc (ptr);
1467  if (*ptr != ',') {
1468  break;
1469  }
1470  ++ptr;
1471  if (!rd_word (&ptr, ',')) {
1472  RZ_LOG_ERROR("assembler: z80: Missing expression in defw\n");
1473  }
1474  }
1475  break;
1476  case Z80_DEFS:
1477  case Z80_DS:
1478  r = rd_expr (&ptr, ',', NULL, sp, 1);
1479  if (r < 0) {
1480  RZ_LOG_ERROR("assembler: z80: ds should have its first argument >=0"
1481  " (not -0x%x)\n", -r);
1482  break;
1483  }
1484  ptr = delspc (ptr);
1485  if (*ptr) {
1486  rd_comma (&ptr);
1487  readbyte = 0;
1488  rd_byte (&ptr, '\0');
1489  writebyte = 0;
1490  break;
1491  }
1492  for (i = 0; i < r; i++) {
1493  write_one_byte (0, 0);
1494  }
1495  break;
1496  case Z80_END:
1497  break;
1498  case Z80_ORG:
1499  addr = rd_expr (&ptr, '\0', NULL, sp, 1) & 0xffff;
1500  break;
1501  case Z80_IF:
1502  break;
1503  case Z80_ELSE:
1504  RZ_LOG_ERROR("assembler: z80: else without if\n");
1505  break;
1506  case Z80_ENDIF:
1507  RZ_LOG_ERROR("assembler: z80: endif without if\n");
1508  break;
1509  case Z80_ENDM:
1510  if (stack[sp].file) {
1511  RZ_LOG_ERROR("assembler: z80: endm outside macro definition\n");
1512  }
1513  break;
1514  case Z80_SEEK:
1515  RZ_LOG_ERROR("assembler: z80: seek error\n");
1516  break;
1517  default:
1518  // RZ_LOG_ERROR("assembler: z80: command or comment expected (was %s)\n", ptr);
1519  return 0;
1520  }
1521 
1522  return obuflen;
1523 }
lzma_index ** i
Definition: index.h:629
#define NULL
Definition: cris-opc.c:27
#define r
Definition: crypto_rc6.c:12
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags cmd
Definition: sflib.h:79
static int rd_expr(const char **p, char delimiter, int *valid, int level, int print_errors)
Definition: expressions.c:750
static int rd_character(const char **p, int *valid, int print_errors)
Definition: expressions.c:106
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
int n
Definition: mipsasm.c:19
static RzSocket * s
Definition: rtr.c:28
#define RZ_LOG_ERROR(fmtstr,...)
Definition: rz_log.h:58
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
Definition: unum.c:456
Definition: gzappend.c:170
Definition: z80asm.h:140
int line
Definition: z80asm.h:144
static int readcommand(const char **p)
Definition: z80asm.c:216
static void readlabel(const char **p, int store)
Definition: z80asm.c:221
static int sp
Definition: z80asm.c:91
static int rd_r_rr(const char **p)
Definition: z80asm.c:600
#define addHL
static const char * delspc(const char *ptr)
Definition: z80asm.c:117
#define HL
static int rd_a_hl(const char **p)
Definition: z80asm.c:360
static int writebyte
Definition: z80asm.c:63
static int rd_jr(const char **p)
Definition: z80asm.c:445
#define A_I
#define wrtb(x)
Definition: z80asm.c:39
static void rd_comma(const char **p)
Definition: z80asm.c:127
static int comma
Definition: z80asm.c:76
static int rd_rrxx(const char **p)
Definition: z80asm.c:519
static int obuflen
Definition: z80asm.c:37
#define write_one_byte(x, y)
Definition: z80asm.c:38
#define ld_BC
static int has_argument(const char **p)
Definition: z80asm.c:137
#define ldA
#define ld_nnA
#define ld_HL
static int baseaddr
Definition: z80asm.c:79
static int rd_byte(const char **p, char delimiter)
Definition: z80asm.c:298
#define ldE
static int rd_ld(const char **p)
Definition: z80asm.c:369
#define ldC
static int rd_r_add(const char **p)
Definition: z80asm.c:477
static int rd_cc(const char **p)
Definition: z80asm.c:592
#define _NN
static int indexed
Definition: z80asm.c:70
#define ld_NN
#define ldSP
static int rd_stack(const char **p)
Definition: z80asm.c:461
static unsigned char * obuf
Definition: z80asm.c:36
static int rd_in(const char **p)
Definition: z80asm.c:321
#define ldHL
static int rd_out(const char **p)
Definition: z80asm.c:330
#define AF
#define ldH
#define ldDE
#define A_R
static int rd_nn_nn(const char **p)
Definition: z80asm.c:755
static int rd_rr_(const char **p)
Definition: z80asm.c:511
static char * z80buffer
Definition: z80asm.c:85
#define ldR
static int rd_r_(const char **p)
Definition: z80asm.c:567
static int rd_ex1(const char **p)
Definition: z80asm.c:311
#define ldD
#define A_NN
#define A_N
static int define_macro
Definition: z80asm.c:88
#define A
static int rd_sp(const char **p)
Definition: z80asm.c:764
static int rd_0_2(const char **p)
Definition: z80asm.c:652
#define SPHL
static int addr
Definition: z80asm.c:58
#define ldI
static int rd_jp(const char **p)
Definition: z80asm.c:427
static int rd_r(const char **p)
Definition: z80asm.c:540
static void skipword(const char **pos, char delimiter)
Definition: z80asm.c:145
static int rd_hlx(const char **p)
Definition: z80asm.c:630
static int rd_a(const char **p)
Definition: z80asm.c:453
static int rd_af_(const char **p)
Definition: z80asm.c:644
#define C
#define DE
static int rd_word(const char **p, char delimiter)
Definition: z80asm.c:286
static int rd_ld_nn(const char **p)
Definition: z80asm.c:674
static int rd_ld_hl(const char **p)
Definition: z80asm.c:660
#define ldL
static int rd_nnc(const char **p)
Definition: z80asm.c:338
#define ld_DE
static int rd_ldbcdehla(const char **p)
Definition: z80asm.c:719
static const char * readword
Definition: z80asm.c:67
static int rd_0_7(const char **p)
Definition: z80asm.c:581
static int rd_hl(const char **p)
Definition: z80asm.c:622
static const char * indexjmp
Definition: z80asm.c:67
static int rd_lda(const char **p)
Definition: z80asm.c:690
#define ld_nnHL
static const char * readbyte
Definition: z80asm.c:64
#define ldB
#define SPNN
#define ldBC
static int rd_c(const char **p)
Definition: z80asm.c:352
@ Z80_RET
Definition: z80asm.h:55
@ Z80_DI
Definition: z80asm.h:58
@ Z80_CCF
Definition: z80asm.h:53
@ Z80_RRCA
Definition: z80asm.h:51
@ Z80_CPIR
Definition: z80asm.h:49
@ Z80_SEEK
Definition: z80asm.h:61
@ Z80_RETN
Definition: z80asm.h:51
@ Z80_RRD
Definition: z80asm.h:56
@ Z80_DJNZ
Definition: z80asm.h:49
@ Z80_CPI
Definition: z80asm.h:53
@ Z80_RLA
Definition: z80asm.h:56
@ Z80_DM
Definition: z80asm.h:60
@ Z80_POP
Definition: z80asm.h:55
@ Z80_ELSE
Definition: z80asm.h:61
@ Z80_OTIR
Definition: z80asm.h:50
@ Z80_IN
Definition: z80asm.h:59
@ Z80_CPDR
Definition: z80asm.h:49
@ Z80_NEG
Definition: z80asm.h:55
@ Z80_RST
Definition: z80asm.h:56
@ Z80_SRA
Definition: z80asm.h:57
@ Z80_RLD
Definition: z80asm.h:56
@ Z80_OUTI
Definition: z80asm.h:51
@ Z80_EX
Definition: z80asm.h:59
@ Z80_RLC
Definition: z80asm.h:56
@ Z80_CPL
Definition: z80asm.h:53
@ Z80_DEC
Definition: z80asm.h:54
@ Z80_ORG
Definition: z80asm.h:58
@ Z80_INC
Definition: z80asm.h:54
@ Z80_EI
Definition: z80asm.h:58
@ Z80_DB
Definition: z80asm.h:60
@ Z80_SLA
Definition: z80asm.h:57
@ Z80_RRC
Definition: z80asm.h:56
@ Z80_OR
Definition: z80asm.h:59
@ Z80_DEFS
Definition: z80asm.h:52
@ Z80_SLI
Definition: z80asm.h:57
@ Z80_HALT
Definition: z80asm.h:49
@ Z80_LD
Definition: z80asm.h:59
@ Z80_INIR
Definition: z80asm.h:50
@ Z80_RETI
Definition: z80asm.h:51
@ Z80_RL
Definition: z80asm.h:59
@ Z80_DEFW
Definition: z80asm.h:52
@ Z80_SRL
Definition: z80asm.h:58
@ Z80_CP
Definition: z80asm.h:58
@ Z80_ADC
Definition: z80asm.h:52
@ Z80_ENDM
Definition: z80asm.h:61
@ Z80_DW
Definition: z80asm.h:60
@ Z80_XOR
Definition: z80asm.h:58
@ Z80_LDDR
Definition: z80asm.h:50
@ Z80_LDD
Definition: z80asm.h:54
@ Z80_RR
Definition: z80asm.h:60
@ Z80_BIT
Definition: z80asm.h:53
@ Z80_DEFM
Definition: z80asm.h:52
@ Z80_SCF
Definition: z80asm.h:57
@ Z80_SUB
Definition: z80asm.h:58
@ Z80_INDR
Definition: z80asm.h:49
@ Z80_AND
Definition: z80asm.h:53
@ Z80_RRA
Definition: z80asm.h:56
@ Z80_EXX
Definition: z80asm.h:54
@ Z80_OUT
Definition: z80asm.h:55
@ Z80_CALL
Definition: z80asm.h:49
@ Z80_CPD
Definition: z80asm.h:53
@ Z80_ADD
Definition: z80asm.h:52
@ Z80_LDIR
Definition: z80asm.h:50
@ Z80_DEFB
Definition: z80asm.h:52
@ Z80_PUSH
Definition: z80asm.h:51
@ Z80_ENDIF
Definition: z80asm.h:61
@ Z80_OUTD
Definition: z80asm.h:50
@ Z80_JP
Definition: z80asm.h:59
@ Z80_IM
Definition: z80asm.h:59
@ Z80_DS
Definition: z80asm.h:60
@ Z80_IND
Definition: z80asm.h:54
@ Z80_INI
Definition: z80asm.h:54
@ Z80_LDI
Definition: z80asm.h:55
@ Z80_IF
Definition: z80asm.h:61
@ Z80_JR
Definition: z80asm.h:59
@ Z80_SET
Definition: z80asm.h:57
@ Z80_RLCA
Definition: z80asm.h:51
@ Z80_SBC
Definition: z80asm.h:57
@ Z80_END
Definition: z80asm.h:61
@ Z80_OTDR
Definition: z80asm.h:50
@ Z80_RES
Definition: z80asm.h:55
@ Z80_DAA
Definition: z80asm.h:53
@ Z80_NOP
Definition: z80asm.h:55

References _NN, A, A_I, A_N, A_NN, A_R, addHL, addr, AF, baseaddr, C, cmd, comma, DE, define_macro, delspc(), has_argument(), HL, i, indexed, indexjmp, ld_BC, ld_DE, ld_HL, ld_NN, ld_nnA, ld_nnHL, ldA, ldB, ldBC, ldC, ldD, ldDE, ldE, ldH, ldHL, ldI, ldL, ldR, ldSP, stack::line, n, NULL, obuf, obuflen, r, rd_0_2(), rd_0_7(), rd_a(), rd_a_hl(), rd_af_(), rd_byte(), rd_c(), rd_cc(), rd_character(), rd_comma(), rd_ex1(), rd_expr(), rd_hl(), rd_hlx(), rd_in(), rd_jp(), rd_jr(), rd_ld(), rd_ld_hl(), rd_ld_nn(), rd_lda(), rd_ldbcdehla(), rd_nn_nn(), rd_nnc(), rd_out(), rd_r(), rd_r_(), rd_r_add(), rd_r_rr(), rd_rr_(), rd_rrxx(), rd_sp(), rd_stack(), rd_word(), readbyte, readcommand(), readlabel(), readword, RZ_LOG_ERROR, rz_num_math(), s, skipword(), sp, SPHL, SPNN, cmd_descs_generate::str, strdup(), write_one_byte, writebyte, wrtb, Z80_ADC, Z80_ADD, Z80_AND, Z80_BIT, Z80_CALL, Z80_CCF, Z80_CP, Z80_CPD, Z80_CPDR, Z80_CPI, Z80_CPIR, Z80_CPL, Z80_DAA, Z80_DB, Z80_DEC, Z80_DEFB, Z80_DEFM, Z80_DEFS, Z80_DEFW, Z80_DI, Z80_DJNZ, Z80_DM, Z80_DS, Z80_DW, Z80_EI, Z80_ELSE, Z80_END, Z80_ENDIF, Z80_ENDM, Z80_EX, Z80_EXX, Z80_HALT, Z80_IF, Z80_IM, Z80_IN, Z80_INC, Z80_IND, Z80_INDR, Z80_INI, Z80_INIR, Z80_JP, Z80_JR, Z80_LD, Z80_LDD, Z80_LDDR, Z80_LDI, Z80_LDIR, Z80_NEG, Z80_NOP, Z80_OR, Z80_ORG, Z80_OTDR, Z80_OTIR, Z80_OUT, Z80_OUTD, Z80_OUTI, Z80_POP, Z80_PUSH, Z80_RES, Z80_RET, Z80_RETI, Z80_RETN, Z80_RL, Z80_RLA, Z80_RLC, Z80_RLCA, Z80_RLD, Z80_RR, Z80_RRA, Z80_RRC, Z80_RRCA, Z80_RRD, Z80_RST, Z80_SBC, Z80_SCF, Z80_SEEK, Z80_SET, Z80_SLA, Z80_SLI, Z80_SRA, Z80_SRL, Z80_SUB, Z80_XOR, and z80buffer.

Referenced by z80asm().

◆ compute_ref()

static int compute_ref ( struct reference ref,
int  allow_invalid 
)
static

Definition at line 255 of file z80asm.c.

255  {
256  const char *ptr;
257  int valid = 0;
258  int backup_addr = addr;
259  int backup_baseaddr = baseaddr;
260  int backup_comma = comma;
261  int backup_file = file;
262  int backup_sp = sp;
263  sp = ref->level;
264  addr = ref->addr;
265  baseaddr = ref->baseaddr;
266  comma = ref->comma;
267  file = ref->infile;
268  ptr = ref->input;
269  if (!ref->done) {
270  ref->computed_value = rd_expr (&ptr, ref->delimiter,
271  allow_invalid? &valid: NULL,
272  ref->level, 1);
273  if (valid) {
274  ref->done = 1;
275  }
276  }
277  sp = backup_sp;
278  addr = backup_addr;
279  baseaddr = backup_baseaddr;
280  comma = backup_comma;
281  file = backup_file;
282  return ref->computed_value;
283 }
char input[1]
Definition: z80asm.h:171
int baseaddr
Definition: z80asm.h:162
char delimiter
Definition: z80asm.h:160
int done
Definition: z80asm.h:166
int level
Definition: z80asm.h:168
int computed_value
Definition: z80asm.h:167
int comma
Definition: z80asm.h:163
int infile
Definition: z80asm.h:165
int addr
Definition: z80asm.h:161
bool valid
Definition: core.c:77
static int file
Definition: z80asm.c:58

References addr, reference::addr, baseaddr, reference::baseaddr, comma, reference::comma, reference::computed_value, reference::delimiter, reference::done, file, reference::infile, reference::input, reference::level, NULL, rd_expr(), label::ref, sp, and valid.

Referenced by check_label().

◆ delspc()

static const char* delspc ( const char *  ptr)
static

Definition at line 117 of file z80asm.c.

117  {
118  while (*ptr && isspace ((const unsigned char) *ptr))
119  ptr++;
120  if (*ptr == ';') {
121  ptr = "";
122  }
123  return ptr;
124 }
#define isspace(c)
Definition: safe-ctype.h:141

References isspace.

Referenced by assemble(), check_label(), do_rd_expr(), has_argument(), indx(), rd_0_7(), rd_byte(), rd_comma(), rd_expr_and(), rd_expr_equal(), rd_expr_or(), rd_expr_shift(), rd_expr_unequal(), rd_expr_xor(), rd_factor(), rd_number(), rd_term(), rd_value(), and rd_word().

◆ has_argument()

static int has_argument ( const char **  p)
static

Definition at line 137 of file z80asm.c.

137  {
138  const char *q = delspc (*p);
139  return *q == ',';
140 }
void * p
Definition: libc.cpp:67

References delspc(), and p.

Referenced by assemble().

◆ indx()

static int indx ( const char **  ptr,
const char **  list,
int  error,
const char **  expr 
)
static

Definition at line 154 of file z80asm.c.

154  {
155  int i;
156  *ptr = delspc (*ptr);
157  if (!**ptr) {
158  if (error) {
159  RZ_LOG_ERROR("assembler: z80: unexpected end of line\n");
160  return 0;
161  } else {
162  return 0;
163  }
164  }
165  if (comma > 1) {
166  rd_comma (ptr);
167  }
168  for (i = 0; list[i]; i++) {
169  const char *input = *ptr;
170  const char *check = list[i];
171  int had_expr = 0;
172  if (!list[i][0]) {
173  continue;
174  }
175  while (*check) {
176  if (*check == ' ') {
177  input = delspc (input);
178  } else if (*check == '*') {
179  *expr = input;
180  mem_delimiter = check[1];
181  rd_expr (&input, mem_delimiter, NULL, sp, 0);
182  had_expr = 1;
183  } else if (*check == '+') {
184  if (*input == '+' || *input == '-') {
185  *expr = input;
186  mem_delimiter = check[1];
187  rd_expr (&input, mem_delimiter, NULL, sp, 0);
188  }
189  } else if (*check == *input || (*check >= 'a' && *check <= 'z'
190  && *check - 'a' + 'A' == *input)) {
191  ++input;
192  } else {
193  break;
194  }
195 
196  ++check;
197  }
198  if (*check || (isalnum ((const unsigned char) check[-1]) && isalnum ((const unsigned char) input[0]))) {
199  continue;
200  }
201  if (had_expr) {
202  input = delspc (input);
203  if (*input && *input != ',') {
204  continue;
205  }
206  }
207  *ptr = input;
208  comma++;
209  return i + 1;
210  }
211  // if (error) RZ_LOG_ERROR("assembler: z80: parse error. Remainder of line=%s\n", *ptr);
212  return 0;
213 }
static RzNumCalcValue expr(RzNum *, RzNumCalc *, int)
Definition: calc.c:167
lzma_check check
Definition: container.h:292
static void list(RzEgg *egg)
Definition: rz-gg.c:52
#define isalnum(c)
Definition: safe-ctype.h:127
void error(const char *msg)
Definition: untgz.c:593
static char mem_delimiter
Definition: z80asm.c:82
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)

References check, comma, delspc(), error(), expr(), i, input(), isalnum, list(), mem_delimiter, NULL, rd_comma(), rd_expr(), RZ_LOG_ERROR, and sp.

Referenced by bin_pe_init_imports(), decode_cmpi(), decode_movi(), decode_movrel(), rd_0_2(), rd_a(), rd_a_hl(), rd_af_(), rd_c(), rd_cc(), rd_ex1(), rd_hl(), rd_hlx(), rd_in(), rd_jp(), rd_jr(), rd_ld(), rd_ld_hl(), rd_ld_nn(), rd_lda(), rd_ldbcdehla(), rd_nn_nn(), rd_nnc(), rd_out(), rd_r(), rd_r_(), rd_r_add(), rd_r_rr(), rd_rr_(), rd_rrxx(), rd_sp(), rd_stack(), and readcommand().

◆ printerr()

static void printerr ( int  error,
const char *  fmt,
  ... 
)
static

Definition at line 98 of file z80asm.c.

98  {
99 #if 0
100  va_list l;
101  va_start (l, fmt);
102  if ((sp < 0) || (stack[sp].name == 0)) {
103  fprintf (stderr, "internal assembler error, sp == %i\n", sp);
104  vfprintf (stderr, fmt, l);
105  }
106  fprintf (stderr, "%s%s:%d: %s: ", stack[sp].dir? stack[sp].dir->name: "",
107  stack[sp].name, stack[sp].line, error? "error": "warning");
108  vfprintf (stderr, fmt, l);
109  va_end (l);
110  if (error) {
111  errors++;
112  }
113 #endif
114 }
Definition: z80asm.h:102
const char * name
Definition: z80asm.h:141

References stack::dir, error(), stack::line, includedir::name, stack::name, and sp.

Referenced by do_rd_expr(), rd_character(), rd_expr(), rd_factor(), rd_label(), rd_otherbasenumber(), and rd_value().

◆ rd_0_2()

static int rd_0_2 ( const char **  p)
static

Definition at line 652 of file z80asm.c.

652  {
653  const char *list[] = {
654  "0", "", "1", "2", NULL
655  };
656  return indx (p, list, 1, NULL);
657 }
static int indx(const char **ptr, const char **list, int error, const char **expr)
Definition: z80asm.c:154

References indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_0_7()

static int rd_0_7 ( const char **  p)
static

Definition at line 581 of file z80asm.c.

581  {
582  *p = delspc (*p);
583  if (**p == 0) {
584  return 0;
585  }
586  bitsetres = *p;
587  skipword (p, ',');
588  return 1;
589 }
static const char * bitsetres
Definition: z80asm.c:67

References bitsetres, delspc(), p, and skipword().

Referenced by assemble().

◆ rd_a()

static int rd_a ( const char **  p)
static

Definition at line 453 of file z80asm.c.

453  {
454  const char *list[] = {
455  "a", NULL
456  };
457  return indx (p, list, 1, NULL);
458 }

References indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_a_hl()

static int rd_a_hl ( const char **  p)
static

Definition at line 360 of file z80asm.c.

360  {
361 #define HL 2
362  const char *list[] = {
363  "a", "hl", NULL
364  };
365  return indx (p, list, 1, NULL);
366 }

References indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_af_()

static int rd_af_ ( const char **  p)
static

Definition at line 644 of file z80asm.c.

644  {
645  const char *list[] = {
646  "af'", NULL
647  };
648  return indx (p, list, 1, NULL);
649 }

References indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_byte()

static int rd_byte ( const char **  p,
char  delimiter 
)
static

Definition at line 298 of file z80asm.c.

298  {
299  *p = delspc (*p);
300  if (**p == 0) {
301  return 0;
302  }
303  readbyte = *p;
304  writebyte = 1;
305  mem_delimiter = delimiter;
306  skipword (p, delimiter);
307  return 1;
308 }

References delspc(), mem_delimiter, p, readbyte, skipword(), and writebyte.

Referenced by assemble().

◆ rd_c()

static int rd_c ( const char **  p)
static

Definition at line 352 of file z80asm.c.

352  {
353  const char *list[] = {
354  "( c )", "( bc )", NULL
355  };
356  return indx (p, list, 1, NULL);
357 }

References indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_cc()

static int rd_cc ( const char **  p)
static

Definition at line 592 of file z80asm.c.

592  {
593  const char *list[] = {
594  "nz", "z", "nc", "c", "po", "pe", "p", "m", NULL
595  };
596  return indx (p, list, 0, NULL);
597 }

References indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_comma()

static void rd_comma ( const char **  p)
static

Definition at line 127 of file z80asm.c.

127  {
128  *p = delspc (*p);
129  if (**p != ',') {
130  RZ_LOG_ERROR("assembler: z80: `,' expected. Remainder of line: %s\n", *p);
131  return;
132  }
133  *p = delspc ((*p) + 1);
134 }

References delspc(), p, and RZ_LOG_ERROR.

Referenced by assemble(), and indx().

◆ rd_ex1()

static int rd_ex1 ( const char **  p)
static

Definition at line 311 of file z80asm.c.

311  {
312 #define DE 2
313 #define AF 3
314  const char *list[] = {
315  "( sp )", "de", "af", NULL
316  };
317  return indx (p, list, 1, NULL);
318 }

References indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_hl()

static int rd_hl ( const char **  p)
static

Definition at line 622 of file z80asm.c.

622  {
623  const char *list[] = {
624  "hl", NULL
625  };
626  return indx (p, list, 1, NULL);
627 }

References indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_hlx()

static int rd_hlx ( const char **  p)
static

Definition at line 630 of file z80asm.c.

630  {
631  int i;
632  const char *list[] = {
633  "hl", "ix", "iy", NULL
634  };
635  i = indx (p, list, 1, NULL);
636  if (i < 2) {
637  return i;
638  }
639  indexed = 0xDD + 0x20 * (i - 2);
640  return 1;
641 }

References i, indexed, indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_in()

static int rd_in ( const char **  p)
static

Definition at line 321 of file z80asm.c.

321  {
322 #define A 8
323  const char *list[] = {
324  "b", "c", "d", "e", "h", "l", "f", "a", NULL
325  };
326  return indx (p, list, 1, NULL);
327 }

References indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_jp()

static int rd_jp ( const char **  p)
static

Definition at line 427 of file z80asm.c.

427  {
428  int i;
429  const char *list[] = {
430  "nz", "z", "nc", "c", "po", "pe", "p", "m", "( ix )", "( iy )",
431  "(hl)", NULL
432  };
433  i = indx (p, list, 0, NULL);
434  if (i < 9) {
435  return i;
436  }
437  if (i == 11) {
438  return -1;
439  }
440  indexed = 0xDD + 0x20 * (i - 9);
441  return -1;
442 }

References i, indexed, indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_jr()

static int rd_jr ( const char **  p)
static

Definition at line 445 of file z80asm.c.

445  {
446  const char *list[] = {
447  "nz", "z", "nc", "c", NULL
448  };
449  return indx (p, list, 0, NULL);
450 }

References indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_ld()

static int rd_ld ( const char **  p)
static

Definition at line 369 of file z80asm.c.

369  {
370 #define ldBC 1
371 #define ldDE 2
372 #define ldHL 3
373 #define ldSP 4
374 #define ldIX 5
375 #define ldIY 6
376 #define ldB 7
377 #define ldC 8
378 #define ldD 9
379 #define ldE 10
380 #define ldH 11
381 #define ldL 12
382 #define ld_HL 13
383 #define ldA 14
384 #define ldI 15
385 #define ldR 16
386 #define ld_BC 17
387 #define ld_DE 18
388 #define ld_IX 19
389 #define ld_IY 20
390 #define ld_NN 21
391  int i;
392  const char *list[] = {
393  "ixh", "ixl", "iyh", "iyl", "bc", "de", "hl", "sp", "ix",
394  "iy", "b", "c", "d", "e", "h", "l", "( hl )", "a", "i",
395  "r", "( bc )", "( de )", "( ix +)", "(iy +)", "(*)", NULL
396  };
397  const char *nn;
398  i = indx (p, list, 1, &nn);
399  if (!i) {
400  return 0;
401  }
402  if (i <= 2) {
403  indexed = 0xdd;
404  return ldH + (i == 2);
405  }
406  if (i <= 4) {
407  indexed = 0xfd;
408  return ldH + (i == 4);
409  }
410  i -= 4;
411  if (i == ldIX || i == ldIY) {
412  indexed = i == ldIX? 0xDD: 0xFD;
413  return ldHL;
414  }
415  if (i == ld_IX || i == ld_IY) {
416  indexjmp = nn;
417  indexed = i == ld_IX? 0xDD: 0xFD;
418  return ld_HL;
419  }
420  if (i == ld_NN) {
421  readword = nn;
422  }
423  return i;
424 }
#define ld_IY
#define ldIX
#define ld_IX
#define ldIY

References i, indexed, indexjmp, indx(), ld_HL, ld_IX, ld_IY, ld_NN, ldH, ldHL, ldIX, ldIY, list(), NULL, p, and readword.

Referenced by assemble().

◆ rd_ld_hl()

static int rd_ld_hl ( const char **  p)
static

Definition at line 660 of file z80asm.c.

660  {
661  int i;
662  const char *list[] = {
663  "b", "c", "d", "e", "h", "l", "", "a", "*", NULL
664  };
665  i = indx (p, list, 0, &readbyte);
666  if (i < 9) {
667  return i;
668  }
669  writebyte = 1;
670  return 7;
671 }

References i, indx(), list(), NULL, p, readbyte, and writebyte.

Referenced by assemble().

◆ rd_ld_nn()

static int rd_ld_nn ( const char **  p)
static

Definition at line 674 of file z80asm.c.

674  {
675 #define ld_nnHL 5
676 #define ld_nnA 6
677  int i;
678  const char *list[] = {
679  "bc", "de", "", "sp", "hl", "a", "ix", "iy", NULL
680  };
681  i = indx (p, list, 1, NULL);
682  if (i < 7) {
683  return i;
684  }
685  indexed = 0xdd + 0x20 * (i == 8);
686  return ld_nnHL;
687 }

References i, indexed, indx(), ld_nnHL, list(), NULL, and p.

Referenced by assemble().

◆ rd_lda()

static int rd_lda ( const char **  p)
static

Definition at line 690 of file z80asm.c.

690  {
691 #define A_N 7
692 #define A_I 9
693 #define A_R 10
694 #define A_NN 11
695  int i;
696  const char *list[] = {
697  "( sp )", "( iy +)", "( de )", "( bc )", "( ix +)", "b", "c", "d", "e", "h",
698  "l", "( hl )", "a", "i", "r", "(*)", "*", NULL
699  };
700  const char *nn;
701  i = indx (p, list, 0, &nn);
702  if (i == 2 || i == 5) {
703  indexed = (i == 2)? 0xFD: 0xDD;
704  indexjmp = nn;
705  return 7;
706  }
707  if (i == 17) {
708  readbyte = nn;
709  writebyte = 1;
710  return 7;
711  }
712  if (i == 16) {
713  readword = nn;
714  }
715  return i - 5;
716 }

References i, indexed, indexjmp, indx(), list(), NULL, p, readbyte, readword, and writebyte.

Referenced by assemble().

◆ rd_ldbcdehla()

static int rd_ldbcdehla ( const char **  p)
static

Definition at line 719 of file z80asm.c.

719  {
720  int i;
721  const char *list[] = {
722  "b", "c", "d", "e", "h", "l", "( hl )", "a", "( ix +)", "( iy +)", "ixh",
723  "ixl", "iyh", "iyl", "*", NULL
724  };
725  const char *nn;
726  i = indx (p, list, 0, &nn);
727  if (i == 15) {
728  readbyte = nn;
729  writebyte = 1;
730  return 7;
731  }
732  if (i > 10) {
733  int x;
734  x = 0xdd + 0x20 * (i > 12);
735  if (indexed && indexed != x) {
736  RZ_LOG_ERROR("assembler: z80: illegal use of index registers\n");
737  return 0;
738  }
739  indexed = x;
740  return 6 - (i & 1);
741  }
742  if (i > 8) {
743  if (indexed) {
744  RZ_LOG_ERROR("assembler: z80: illegal use of index registers\n");
745  return 0;
746  }
747  indexed = 0xDD + 0x20 * (i == 10);
748  indexjmp = nn;
749  return 7;
750  }
751  return i;
752 }
int x
Definition: mipsasm.c:20

References i, indexed, indexjmp, indx(), list(), NULL, p, readbyte, RZ_LOG_ERROR, writebyte, and x.

Referenced by assemble().

◆ rd_nn_nn()

static int rd_nn_nn ( const char **  p)
static

Definition at line 755 of file z80asm.c.

755  {
756 #define _NN 1
757  const char *list[] = {
758  "(*)", "*", NULL
759  };
760  return 2 - indx (p, list, 0, &readword);
761 }

References indx(), list(), NULL, p, and readword.

Referenced by assemble().

◆ rd_nnc()

static int rd_nnc ( const char **  p)
static

Definition at line 338 of file z80asm.c.

338  {
339 #define C 1
340  int i;
341  const char *list[] = {
342  "( c )", "(*)", "a , (*)", NULL
343  };
344  i = indx (p, list, 1, &readbyte);
345  if (i < 2) {
346  return i;
347  }
348  return 2;
349 }

References i, indx(), list(), NULL, p, and readbyte.

Referenced by assemble().

◆ rd_out()

static int rd_out ( const char **  p)
static

Definition at line 330 of file z80asm.c.

330  {
331  const char *list[] = {
332  "b", "c", "d", "e", "h", "l", "0", "a", NULL
333  };
334  return indx (p, list, 1, NULL);
335 }

References indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_r()

static int rd_r ( const char **  p)
static

Definition at line 540 of file z80asm.c.

540  {
541  int i;
542  const char *nn;
543  const char *list[] = {
544  "ixl", "ixh", "iyl", "iyh", "b", "c", "d", "e", "h", "l", "( hl )",
545  "a", "( ix +)", "( iy +)", "*", NULL
546  };
547  i = indx (p, list, 0, &nn);
548  if (i == 15) { /* expression */
549  readbyte = nn;
550  writebyte = 1;
551  return 7;
552  }
553  if (i <= 4) {
554  indexed = 0xdd + 0x20 * (i > 2);
555  return 6 - (i & 1);
556  }
557  i -= 4;
558  if (i < 9) {
559  return i;
560  }
561  indexed = 0xDD + 0x20 * (i - 9);
562  indexjmp = nn;
563  return 7;
564 }

References i, indexed, indexjmp, indx(), list(), NULL, p, readbyte, and writebyte.

Referenced by assemble().

◆ rd_r_()

static int rd_r_ ( const char **  p)
static

Definition at line 567 of file z80asm.c.

567  {
568  int i;
569  const char *list[] = {
570  "b", "c", "d", "e", "h", "l", "( hl )", "a", "( ix +)", "( iy +)", NULL
571  };
572  i = indx (p, list, 1, &indexjmp);
573  if (i < 9) {
574  return i;
575  }
576  indexed = 0xDD + 0x20 * (i - 9);
577  return 7;
578 }

References i, indexed, indexjmp, indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_r_add()

static int rd_r_add ( const char **  p)
static

Definition at line 477 of file z80asm.c.

477  {
478 #define addHL 15
479  int i;
480  const char *list[] = {
481  "ixl", "ixh", "iyl", "iyh", "b", "c", "d", "e", "h", "l",
482  "( hl )", "a", "( ix +)", "( iy +)", "hl", "ix", "iy", "*", NULL
483  };
484  const char *nn;
485  i = indx (p, list, 0, &nn);
486  if (i == 18) { /* expression */
487  readbyte = nn;
488  writebyte = 1;
489  return 7;
490  }
491  if (i > 14) { /* hl, ix, iy */
492  if (i > 15) {
493  indexed = 0xDD + 0x20 * (i - 16);
494  }
495  return addHL;
496  }
497  if (i <= 4) { /* i[xy][hl] */
498  indexed = 0xdd + 0x20 * (i > 2);
499  return 6 - (i & 1);
500  }
501  i -= 4;
502  if (i < 9) {
503  return i;
504  }
505  indexed = 0xDD + 0x20 * (i - 9); /* (i[xy] +) */
506  indexjmp = nn;
507  return 7;
508 }

References addHL, i, indexed, indexjmp, indx(), list(), NULL, p, readbyte, and writebyte.

Referenced by assemble().

◆ rd_r_rr()

static int rd_r_rr ( const char **  p)
static

Definition at line 600 of file z80asm.c.

600  {
601  int i;
602  const char *list[] = {
603  "iy", "ix", "sp", "hl", "de", "bc", "", "b", "c", "d", "e", "h",
604  "l", "( hl )", "a", "( ix +)", "( iy +)", NULL
605  };
606  i = indx (p, list, 1, &indexjmp);
607  if (!i) {
608  return 0;
609  }
610  if (i < 16 && i > 2) {
611  return 7 - i;
612  }
613  if (i > 15) {
614  indexed = 0xDD + (i - 16) * 0x20;
615  return -7;
616  }
617  indexed = 0xDD + (2 - i) * 0x20;
618  return 3;
619 }

References i, indexed, indexjmp, indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_rr_()

static int rd_rr_ ( const char **  p)
static

Definition at line 511 of file z80asm.c.

511  {
512  const char *list[] = {
513  "bc", "de", "hl", "sp", NULL
514  };
515  return indx (p, list, 1, NULL);
516 }

References indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_rrxx()

static int rd_rrxx ( const char **  p)
static

Definition at line 519 of file z80asm.c.

519  {
520  const char *listx[] = {
521  "bc", "de", "ix", "sp", NULL
522  };
523  const char *listy[] = {
524  "bc", "de", "iy", "sp", NULL
525  };
526  const char *list[] = {
527  "bc", "de", "hl", "sp", NULL
528  };
529  if (indexed == 0xdd) {
530  return indx (p, listx, 1, NULL);
531  }
532  if (indexed == 0xfd) {
533  return indx (p, listy, 1, NULL);
534  }
535  return indx (p, list, 1, NULL);
536 }

References indexed, indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_sp()

static int rd_sp ( const char **  p)
static

Definition at line 764 of file z80asm.c.

764  {
765 #define SPNN 0
766 #define SPHL 1
767  int i;
768  const char *list[] = {
769  "hl", "ix", "iy", "(*)", "*", NULL
770  };
771  const char *nn;
772  i = indx (p, list, 0, &nn);
773  if (i > 3) {
774  readword = nn;
775  return i == 4? 2: 0;
776  }
777  if (i != 1) {
778  indexed = 0xDD + 0x20 * (i - 2);
779  }
780  return 1;
781 }

References i, indexed, indx(), list(), NULL, p, and readword.

Referenced by assemble().

◆ rd_stack()

static int rd_stack ( const char **  p)
static

Definition at line 461 of file z80asm.c.

461  {
462  int i;
463  const char *list[] = {
464  "bc", "de", "hl", "af", "ix", "iy", NULL
465  };
466  i = indx (p, list, 1, NULL);
467  if (i < 5) {
468  return i;
469  }
470  indexed = 0xDD + 0x20 * (i - 5);
471  return 3;
472 }

References i, indexed, indx(), list(), NULL, and p.

Referenced by assemble().

◆ rd_word()

static int rd_word ( const char **  p,
char  delimiter 
)
static

Definition at line 286 of file z80asm.c.

286  {
287  *p = delspc (*p);
288  if (**p == 0) {
289  return 0;
290  }
291  readword = *p;
292  mem_delimiter = delimiter;
293  skipword (p, delimiter);
294  return 1;
295 }

References delspc(), mem_delimiter, p, readword, and skipword().

Referenced by assemble().

◆ readcommand()

static int readcommand ( const char **  p)
static

Definition at line 216 of file z80asm.c.

216  {
217  return indx (p, mnemonics, 0, NULL);
218 }
static const char * mnemonics[]
Definition: z80asm.c:43

References indx(), mnemonics, NULL, and p.

Referenced by assemble().

◆ readlabel()

static void readlabel ( const char **  p,
int  store 
)
static

Definition at line 221 of file z80asm.c.

221  {
222  const char *c, *d, *pos, *dummy;
223  int i, j;
224  struct label *previous;
225  for (d = *p; *d && *d != ';'; d++) {
226  ;
227  }
228  for (c = *p; !strchr (" \r\n\t", *c) && c < d; c++) {
229  ;
230  }
231  pos = strchr (*p, ':');
232  if (!pos || pos >= c) {
233  return;
234  }
235  if (pos == *p) {
236  RZ_LOG_ERROR("assembler: z80: `:' found without a label");
237  return;
238  }
239  if (!store) {
240  *p = pos + 1;
241  return;
242  }
243  c = pos + 1;
244  dummy = *p;
245  j = rd_label (&dummy, &i, &previous, sp, 0);
246  if (i || j) {
247  RZ_LOG_ERROR("assembler: z80: duplicate definition of label %s\n", *p);
248  *p = c;
249  return;
250  }
251 
252  *p = c;
253 }
static int rd_label(const char **p, int *exists, struct label **previous, int level, int print_errors)
Definition: expressions.c:246
#define d(i)
Definition: sha256.c:44
#define c(i)
Definition: sha256.c:43
Definition: dis.h:35
int pos
Definition: main.c:11

References c, d, i, p, pos, rd_label(), RZ_LOG_ERROR, and sp.

Referenced by assemble().

◆ skipword()

static void skipword ( const char **  pos,
char  delimiter 
)
static

Definition at line 145 of file z80asm.c.

145  {
146  /* rd_expr will happily read the expression, and possibly return
147  * an invalid result. It will update pos, which is what we need. */
148  /* Pass valid to allow using undefined labels without errors. */
149  int valid;
150  rd_expr (pos, delimiter, &valid, sp, 0);
151 }

References pos, rd_expr(), sp, and valid.

Referenced by assemble(), rd_0_7(), rd_byte(), and rd_word().

◆ z80asm()

RZ_API_I int z80asm ( unsigned char *  outbuf,
const char *  s 
)

Definition at line 1526 of file z80asm.c.

1526  {
1527  return assemble (s, outbuf);
1528 }
unsigned char outbuf[SIZE]
Definition: gun.c:162
static int assemble(const char *str, unsigned char *_obuf)
Definition: z80asm.c:784

References assemble(), outbuf, and s.

Referenced by do_assemble().

Variable Documentation

◆ addr

int addr = 0
static

Definition at line 58 of file z80asm.c.

Referenced by _6502_op(), __add_menu(), __analysis_esil_function(), __bb_addr_cmp(), __break_points_cb(), __core_analysis_fcn(), __cursor_up(), __disasm(), __fcn_exists(), __handle_mouse_on_panel(), __handleComment(), __jmp_to_cursor_addr(), __opaddr(), __panels_process(), __prelude_cb_hit(), __read(), __refs(), __seek_all(), __set_addr_by_type(), __set_panel_addr(), __update_menu(), __watch_points_cb(), __write(), __xrefs(), _analysis_calls(), _cb_hit(), _CbInRangeSearchV(), _cs_disasm(), _pointer_table(), _server_handle_M(), _server_handle_m(), _server_handle_z(), aarch64_print_operand(), add_arch_platform_flag_comment_cb(), add_comment(), add_hit_to_hits(), add_hit_to_sorted_hits(), add_map(), add_mem_change(), add_mmio_extended_flag_cb(), add_mmio_flag_cb(), add_refline(), add_reg_change(), add_single_addr_xrefs(), add_trace_tree_child(), addptr(), addr_hint_acc_cb(), addr_hint_range_delete_cb(), addsym(), adr(), adrp(), agraph_refresh(), align_address_to_size(), alignCheck(), all_in(), all_intersect(), analize_addr_cb(), analop(), analop_vle(), analPathFollow(), analPaths(), analysis_block_cb(), analysis_branch(), analysis_call(), analysis_function_vars_getsetref(), analysis_graph_to(), analysis_jmpl(), analysis_op(), analysis_pic_midrange_op(), analysis_pic_op(), analysis_pic_pic18_op(), annotated_hexdump(), anop(), anop32(), anop64(), anop_esil(), apply_bank(), arc_op(), arcAnalyzeInstr(), arch_hint_acc_cb(), archbits(), arcompact_branch(), arcompact_genops(), arcompact_genops_jmp(), arcompact_jump(), arcompact_jump_cond(), arcompact_op(), ARCTangent_decodeInstr(), arg(), arm64ass(), array_add(), assemble(), autocomplete_breakpoints(), automerge_predecessor_successor_cb(), avr_custom_spm_page_erase(), avr_custom_spm_page_fill(), avr_custom_spm_page_write(), avr_il_load_reg(), avr_il_st(), avr_il_store_pure(), avr_il_store_reg(), avr_op(), backtrace_fuzzy(), backup_current_addr(), bb_info_print(), bbBegin(), bbFail(), bbget(), bbInstructions(), bbJump(), bbSize(), bdot(), bf_op(), bfd_get_bits(), bfd_getb16(), bfd_getb32(), bfd_getl16(), bfd_getl32(), bin_elf_versioninfo_versym(), binsym(), bits_hint_acc_cb(), block_new(), block_recurse_successor_cb(), bochs_read(), bp_bits_at(), bp_is_mapped(), branch(), buf_bytes_seek(), buf_file_seek(), buf_io_fd_seek(), buf_io_seek(), buf_move_back(), buf_ref_seek(), buf_seek(), buf_sparse_seek(), canWrite(), check_label(), checkHeader(), chip8_anop(), chunk_cmp(), chunk_index_in(), cil_analyze_op(), classes(), clear_bb_vars(), cmd_address_info(), cmd_aea(), cmd_analysis_esil(), cmd_analysis_graph(), cmd_analysis_ucall_ref(), cmd_debug_backtrace(), cmd_debug_current_modules(), cmd_pxr(), collect_nodes_at(), collect_nodes_in(), colorfor_cb(), compute_ref(), construct_rop_gadget(), core_analysis_bytes_desc(), core_analysis_bytes_esil(), core_analysis_bytes_size(), core_analysis_graph_label(), core_flg_class_set(), core_flg_fcn_set(), cpu_memory_map(), cr16_op(), create_section_from_phdr(), create_section_plt(), dalvik_op(), debug_gdb_read_at(), debug_gdb_write_at(), debug_qnx_read_at(), debug_qnx_write_at(), decode_jmp(), decode_ldr_set_addr(), DecodeLFHEntry(), DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), del(), deserialize_memory_cb(), deserialize_registers_cb(), diffrow(), disasm_strings(), disasm_until_ret(), do_debug_trace_calls(), do_esil_search(), do_iter_offsets(), do_rd_expr(), do_ref_search(), drx_get_at(), drx_list(), drx_set(), ds_build_op_str(), ds_init(), ds_pre_emulation(), ds_print_core_vmode(), ds_print_esil_analysis(), ds_print_shortcut(), ds_show_flags(), ds_sub_jumps(), dsmOneArcInst(), dump_maps(), ebc_analysis_call(), ebc_analysis_jmp(), ebc_analysis_jmp8(), ebc_op(), encode_addr16(), encode_addr32(), ensure_addr_hint_record(), ensure_ranged_hint_record(), entries(), esil_peek_n(), esil_poke_n(), esilbreak_mem_read(), esilbreak_mem_write(), exi_bit(), exi_dir1(), exprmatch(), exr_bit(), exr_dir1(), extract_addr_from_code(), extract_arg(), extract_reladdr(), extract_signed_integer(), extract_unsigned_integer(), exw_bit(), exw_dir1(), exw_dir2(), fcn_append_basic_block(), fcn_takeover_block_recursive_followthrough_cb(), fd_read_at_wrap(), fd_write_at_wrap(), fetch_data(), fields(), filter(), find_addr(), find_bb(), find_block_at_xref_addr(), find_core_reg(), find_matching_bracket(), find_node_at(), find_node_in(), fold_asm_trace(), follow_ref(), foreachOffset(), free_rz_addr(), function_rename(), gb_anop(), gb_op_calljump(), get_backtrace_info(), get_body(), get_closest_map(), get_comments_cb(), get_const_ext_from_addr(), get_corner_char(), get_dynamic_elf_symbols(), get_elf_intrp(), get_entrypoint(), get_esil_stack_name(), get_got_entry(), get_kernel_base(), get_main(), get_main_offset_linux_64_pie(), get_main_offset_x86_gcc(), get_main_offset_x86_non_pie(), get_module_timestamp(), get_ptr(), get_ptr_at(), get_ptr_ble(), get_reg_at(), get_relocs(), get_relocs_entry_from_dt_dynamic_aux(), get_section_name(), get_sections(), get_sections_from_dt_dynamic(), get_src_regname(), get_stubs_info(), get_symbols(), get_title(), getFunctionName(), getName(), getNameDelta(), getpcfromstack(), getref(), getRefPtr(), GH(), global_var_load_cb(), goto_asmqjmps(), gprobe_read(), gprobe_runcode(), gprobe_write(), graph_breakpoint(), h8300_analysis_jsr(), h8300_op(), handle_arm_hint(), handle_arm_special_symbol(), handle_skip_next_instruction(), handle_var_stack_access(), hasrefs_cb(), hex_disasm_with_templates(), hex_extend_op(), hex_get_instr_at_addr(), hex_get_pkt(), hexagon_disasm_instruction(), hexagon_get_pkt_index_of_addr(), hexagon_reverse_opcode(), hexagon_v6_op(), hints_acc_store_cb(), hints_at_addr(), hints_load_cb(), hit(), hook_mem_read(), hook_mem_write(), hook_NOP_mem_write(), i4004_op(), i8051_op(), i8080_op(), in_physical_phdr(), in_virtual_phdr(), inBetween(), init_dynstr_aux(), initialize_stack(), initializeEsil(), inRange(), insn_to_op(), INST_HANDLER(), inSymtab(), internal_esil_mem_read(), internal_esil_mem_read_no_null(), internal_esil_mem_write(), internal_esil_mem_write_no_null(), io_map_add(), io_map_new(), is_delta_pointer_table(), is_in_symbol_range(), is_repeatable_inst(), is_skippable_addr(), is_string_at(), is_x86_call(), is_x86_ret(), iscallret(), isInvalid(), isValid(), isValidAddress(), java_analysis(), jemalloc_get_chunks(), jmp(), jmp_dest(), ldr(), len_fixup(), libs(), lines(), listcb(), listxrefs(), load_effect(), loadGP(), lsop(), lua53_anal_op(), lua54_anal_op(), m68k_read_disassembler_16(), m68k_read_disassembler_32(), m68k_read_disassembler_64(), m68k_read_safe_16(), m68k_read_safe_32(), m68k_read_safe_64(), MACH0_(), mach_headerfields(), mal_analysis(), map_cpu_memory(), map_direct_addr(), mcore_analysis(), mcore_snprint(), meta_for_reloc(), meta_function_comment_remove(), meta_gb_bankswitch_cmt(), meta_get_flag(), meta_load_cb(), meta_remove(), meta_remove_size(), meta_set_flag(), meta_set_string(), meta_string_8bit_add(), meta_string_guess_add(), mips_j(), mips_op(), moduleAt(), msp430_op(), mymemread(), mymemwrite(), mymemwrite2(), myregwrite(), myvalid(), n_oper_to_addr(), need_add2history(), noreturn_recurse(), num_callback(), ocaml_cs_disasm(), ocaml_cs_disasm_internal(), on_fcn_delete(), on_fcn_new(), on_fcn_rename(), on_map_skyline(), op(), op0_memimmhandle(), op1_memimmhandle(), op_cache_get(), open_nobin_file(), opiscall(), or1k_op(), parse_bdot(), pdb_set_symbols(), perform_mapped_file_yank(), pic18_cond_branch(), post_address(), prepend_current_pc(), prevop_addr(), prevOpcode(), print_addr(), print_addr_hint_cb(), print_arch_hint_cb(), print_arena_stats(), print_bits_hint_cb(), print_cmd_analysis_after_traps_print(), print_debug_map_line(), print_debug_maps_ascii_art(), print_fcn_arg(), print_function_labels_cb(), print_insn_aarch64(), print_insn_arg(), print_insn_cris_generic(), print_insn_mode(), print_loop(), print_meta_list(), print_rop(), print_with_operands(), proc_mem_img(), process_reference_noreturn_cb(), propagate_return_type_pointer(), propeller_op(), prune_hits_in_addr_range(), ptrace_wrap(), pyc_op(), qnxr_read_memory(), qnxr_write_memory(), ranged_hint_record_cmp(), rasm_disasm(), raw_rtti_parse(), rd_character(), rd_expr_and(), rd_expr_equal(), rd_expr_or(), rd_expr_shift(), rd_expr_unequal(), rd_expr_xor(), rd_factor(), rd_label(), rd_number(), rd_otherbasenumber(), rd_term(), rd_value(), read_ahead(), read_desc(), read_elf_intrp(), read_entry(), read_image_clr_header(), read_image_debug_directory_entry(), read_image_delay_import_directory(), read_image_export_directory(), read_image_import_directory(), read_image_metadata_tilde_header(), read_image_resource_data_entry(), read_image_resource_directory(), read_image_resource_directory_entry(), read_image_section_header(), read_memory64_list(), read_module(), read_nt_headers(), read_tls_directory(), readDword(), readQword(), rebase_offset_to_paddr(), recovery_analysis_complete_object_locator(), recovery_analysis_type_descriptor(), recurse_bb(), refline_kept(), relocation_function_process_noreturn(), relocation_noreturn_process(), resolve_mig_subsystem(), resolve_n_register(), resolve_syscalls(), restore_current_addr(), retpoline_reg(), rfe(), riscv_op(), rjmp(), rjmp_dest(), rsp_mem_addr(), rsp_op(), rtti_itanium_class_type_info_init(), rtti_itanium_class_type_info_new(), rtti_itanium_read_type_name(), rtti_itanium_read_type_name_custom(), rtti_itanium_si_class_type_info_init(), rtti_itanium_si_class_type_info_new(), rtti_itanium_vmi_class_type_info_init(), rtti_itanium_vmi_class_type_info_new(), rtti_msvc_addr(), rtti_msvc_print_class_hierarchy_descriptor(), rtti_msvc_print_complete_object_locator(), rtti_msvc_print_type_descriptor(), rtti_msvc_read_base_class_array(), rtti_msvc_read_base_class_descriptor(), rtti_msvc_read_class_hierarchy_descriptor(), rtti_msvc_read_complete_object_locator(), rtti_msvc_read_type_descriptor(), run_basic_block_analysis(), run_old_command(), rz_analysis_addr_hints_at(), rz_analysis_basic_block_find_paths_handler(), rz_analysis_basic_block_list_handler(), rz_analysis_block_analyze_ops(), rz_analysis_block_chop_noreturn(), rz_analysis_block_op_starts_at(), rz_analysis_block_relocate(), rz_analysis_block_split(), rz_analysis_blocks_foreach_in(), rz_analysis_blocks_foreach_intersect(), rz_analysis_case_op_new(), rz_analysis_check_fcn(), rz_analysis_class_method_exists_by_addr(), rz_analysis_class_method_get_by_addr(), rz_analysis_class_rename_flag(), rz_analysis_class_set_flag(), rz_analysis_create_block(), rz_analysis_create_function(), rz_analysis_data(), rz_analysis_data_kind(), rz_analysis_data_new(), rz_analysis_data_new_string(), rz_analysis_esil_init_mem_handler(), rz_analysis_esil_init_mem_remove_handler(), rz_analysis_esil_mem_read(), rz_analysis_esil_mem_write(), rz_analysis_esil_set_pc(), rz_analysis_fcn(), rz_analysis_fcn_add_bb(), rz_analysis_fcn_bbget_at(), rz_analysis_fcn_bbget_in(), rz_analysis_fcn_del(), rz_analysis_fcn_del_locs(), rz_analysis_fcn_next(), rz_analysis_function_blocks_add_handler(), rz_analysis_function_blocks_color_handler(), rz_analysis_function_contains(), rz_analysis_function_del_handler(), rz_analysis_function_delete_label(), rz_analysis_function_delete_label_at(), rz_analysis_function_get_label(), rz_analysis_function_get_label_at(), rz_analysis_function_get_var_reg_at(), rz_analysis_function_get_var_stackptr_at(), rz_analysis_function_relocate(), rz_analysis_function_set_label(), rz_analysis_function_vars_bp_getref_handler(), rz_analysis_function_vars_bp_setref_handler(), rz_analysis_function_vars_regs_getref_handler(), rz_analysis_function_vars_regs_setref_handler(), rz_analysis_function_vars_sp_getref_handler(), rz_analysis_function_vars_sp_setref_handler(), rz_analysis_functions_merge_handler(), rz_analysis_get_block_at(), rz_analysis_get_blocks_in(), rz_analysis_get_blocks_intersect(), rz_analysis_get_fcn_in(), rz_analysis_get_fcn_in_bounds(), rz_analysis_get_function_at(), rz_analysis_get_functions_in(), rz_analysis_get_used_function_var(), rz_analysis_global_variable_add_handler(), rz_analysis_global_variable_delete_byaddr_handler(), rz_analysis_hint_arch_at(), rz_analysis_hint_bits_at(), rz_analysis_hint_del(), rz_analysis_hint_get(), rz_analysis_hint_set_arch(), rz_analysis_hint_set_bits(), rz_analysis_hint_set_immbase(), rz_analysis_hint_unset_arch(), rz_analysis_hint_unset_bits(), rz_analysis_hint_unset_esil(), rz_analysis_hint_unset_fail(), rz_analysis_hint_unset_high(), rz_analysis_hint_unset_immbase(), rz_analysis_hint_unset_jump(), rz_analysis_hint_unset_newbits(), rz_analysis_hint_unset_nword(), rz_analysis_hint_unset_offset(), rz_analysis_hint_unset_opcode(), rz_analysis_hint_unset_pointer(), rz_analysis_hint_unset_ret(), rz_analysis_hint_unset_size(), rz_analysis_hint_unset_stackframe(), rz_analysis_hint_unset_syntax(), rz_analysis_hint_unset_type(), rz_analysis_hint_unset_val(), rz_analysis_il_get_mem_op_trace(), rz_analysis_il_mem_trace_contains(), rz_analysis_il_trace_instruction_new(), rz_analysis_il_vm_step(), rz_analysis_noreturn_add(), rz_analysis_noreturn_at(), rz_analysis_noreturn_at_addr(), rz_analysis_noreturn_functions(), rz_analysis_op(), rz_analysis_op_hexstr(), rz_analysis_op_reg_delta(), rz_analysis_reflines_get(), rz_analysis_reflines_middle(), rz_analysis_reflines_str(), rz_analysis_rtti_itanium_print_at_vtable(), rz_analysis_rtti_msvc_print_base_class_descriptor(), rz_analysis_rtti_msvc_print_class_hierarchy_descriptor(), rz_analysis_rtti_msvc_print_complete_object_locator(), rz_analysis_rtti_msvc_print_type_descriptor(), rz_analysis_rtti_print_at_vtable(), rz_analysis_switch_op_add_case(), rz_analysis_switch_op_new(), rz_analysis_trace_bb(), rz_analysis_type_link_at(), rz_analysis_type_link_exists(), rz_analysis_type_paths_by_address(), rz_analysis_type_set_link(), rz_analysis_type_unlink(), rz_analysis_update_analysis_range(), rz_analysis_value_set_ut64(), rz_analysis_var_get_access_at(), rz_analysis_var_get_dst_var(), rz_analysis_var_global_delete_byaddr_at(), rz_analysis_var_global_delete_byaddr_in(), rz_analysis_var_global_get_byaddr_at(), rz_analysis_var_global_get_byaddr_in(), rz_analysis_var_global_list_show(), rz_analysis_var_global_new(), rz_analysis_vtable_parse_at(), rz_analysis_xrefs_get_from(), rz_analysis_xrefs_get_to(), rz_analysis_xrefs_to_graph_cmd_handler(), rz_arm_cs_analysis_op_32_esil(), rz_arm_it_apply_cond(), rz_asm_from_string(), rz_asm_to_string(), rz_avr_esil_opcode(), rz_bflt_get_entry(), rz_bin_addr2line(), rz_bin_addr2text(), rz_bin_elf_add_addr(), rz_bin_elf_add_off(), rz_bin_elf_fix_arm_thumb_addr(), rz_bin_elf_get_fini_offset(), rz_bin_elf_get_gnu_hash_table(), rz_bin_elf_get_hash_table(), rz_bin_elf_get_init_offset(), rz_bin_elf_is_thumb_addr(), rz_bin_elf_mul_addr(), rz_bin_elf_mul_off(), rz_bin_java_class_entrypoints(), rz_bin_java_class_methods_as_symbols(), rz_bin_java_class_resolve_symbol(), rz_bin_object_addr_with_base(), rz_bin_omf_get_entry(), rz_bin_relocs_patch_find_targets_map_base(), rz_bin_source_line_info_get_first_at(), rz_bin_string_filter(), rz_bin_strpurge(), rz_bin_te_get_main_paddr(), rz_bp_add(), rz_bp_add_hw(), rz_bp_add_sw(), rz_bp_del(), rz_bp_enable(), rz_bp_get_at(), rz_bp_get_bytes(), rz_bp_get_ending_at(), rz_bp_get_in(), rz_bp_get_index_at(), rz_bp_restore_except(), rz_bp_set_trace(), rz_bp_size_at(), rz_bp_traptrace_next(), rz_bp_watch_add(), rz_buf_fread_at(), rz_buf_fwd_scan(), rz_buf_fwrite_at(), rz_buf_get_nstring(), rz_buf_get_string(), rz_buf_insert_bytes(), rz_buf_read8_at(), rz_buf_read_at(), rz_buf_seek(), rz_buf_sleb128_at(), rz_buf_uleb128_at(), rz_buf_write8_at(), rz_buf_write_at(), rz_cmd_cmp_hex_block_handler(), rz_cmd_cmp_hex_diff_lines_handler(), rz_cmd_debug_allocate_maps_handler(), rz_cmd_debug_deallocate_map_handler(), rz_cmd_debug_dmi(), rz_cmd_debug_dml_handler(), rz_cmd_debug_dmL_handler(), rz_cmd_debug_dmS_handler(), rz_cmd_debug_map_current_handler(), rz_cmd_debug_remove_bp_index_handler(), rz_cmd_debug_step_prog_handler(), rz_cmd_debug_trace_add_addrs_handler(), rz_cmd_debug_trace_calls_handler(), rz_cmd_heap_chunk_print_handler(), rz_cmd_help(), rz_cmd_search(), rz_coff_get_entry(), rz_coff_rebase_sym(), rz_core_add_asmqjmp(), rz_core_analysis_address(), rz_core_analysis_all(), rz_core_analysis_bb_info_print(), rz_core_analysis_bb_seek(), rz_core_analysis_bytes(), rz_core_analysis_callgraph(), rz_core_analysis_calls(), rz_core_analysis_coderefs(), rz_core_analysis_codexrefs(), rz_core_analysis_continue_until_call(), rz_core_analysis_continue_until_syscall(), rz_core_analysis_cycles(), rz_core_analysis_data(), rz_core_analysis_datarefs(), rz_core_analysis_esil(), rz_core_analysis_esil_emulate(), rz_core_analysis_esil_init_mem(), rz_core_analysis_esil_init_mem_del(), rz_core_analysis_esil_init_mem_p(), rz_core_analysis_esil_step_over_until(), rz_core_analysis_fcn_clean(), rz_core_analysis_fcn_merge(), rz_core_analysis_function_add(), rz_core_analysis_function_rename(), rz_core_analysis_function_until(), rz_core_analysis_get_comments(), rz_core_analysis_graph(), rz_core_analysis_graph_to(), rz_core_analysis_hint_print(), rz_core_analysis_importxrefs(), rz_core_analysis_name(), rz_core_analysis_op(), rz_core_analysis_optype_colorfor(), rz_core_analysis_propagate_noreturn(), rz_core_analysis_read_at(), rz_core_analysis_rename(), rz_core_analysis_type_match(), rz_core_arch_bits_at(), rz_core_asm_back_disassemble(), rz_core_asm_back_disassemble_all(), rz_core_asm_back_disassemble_byte(), rz_core_asm_back_disassemble_instr(), rz_core_asm_bwdisassemble(), rz_core_asm_strsearch(), rz_core_bin_apply_imports(), rz_core_bin_apply_main(), rz_core_bin_apply_maps(), rz_core_bin_apply_relocs(), rz_core_bin_apply_sections(), rz_core_bin_apply_symbols(), rz_core_bin_export_info(), rz_core_bin_imports_print(), rz_core_bin_main_print(), rz_core_bin_relocs_print(), rz_core_cmd_foreach(), rz_core_cmd_foreach3(), rz_core_cmd_lastcmd_repeat(), rz_core_cmd_subst_i(), rz_core_cmp_mem_data(), rz_core_cmpwatch_add(), rz_core_cmpwatch_del(), rz_core_cmpwatch_get(), rz_core_cmpwatch_revert(), rz_core_cmpwatch_show(), rz_core_cmpwatch_update(), rz_core_debug_bp_add(), rz_core_debug_breakpoint_toggle(), rz_core_debug_continue_until(), rz_core_debug_esil(), rz_core_debug_map_print(), rz_core_debug_step_over(), rz_core_debug_step_skip(), rz_core_disasm_instruction(), rz_core_disassemble_bytes(), rz_core_disassemble_instr(), rz_core_dump(), rz_core_esil_step(), rz_core_extend_at(), rz_core_file_open_load(), rz_core_file_reopen_remote_debug(), rz_core_flag_describe(), rz_core_gdiff_function_1_file(), rz_core_gdiff_function_2_files(), rz_core_get_boundaries_prot(), rz_core_get_reloc_to(), rz_core_get_section_name(), rz_core_getreloc(), rz_core_link_stroff(), rz_core_magic(), rz_core_magic_at(), rz_core_meta_append(), rz_core_meta_comment_add(), rz_core_meta_editor(), rz_core_meta_pascal_string_add(), rz_core_meta_print_list_at(), rz_core_meta_print_list_in_function(), rz_core_meta_string_add(), rz_core_op_analysis(), rz_core_op_str(), rz_core_pava(), rz_core_print_disasm(), rz_core_print_disasm_all(), rz_core_print_disasm_json(), rz_core_print_dump(), rz_core_print_dump_str(), rz_core_print_examine(), rz_core_print_hexdump(), rz_core_print_hexdump_byline(), rz_core_print_hexdump_byline_str(), rz_core_print_hexdump_or_hexdiff(), rz_core_print_hexdump_or_hexdiff_str(), rz_core_print_offname(), rz_core_print_offsize(), rz_core_search_rop(), rz_core_search_value_in_range(), rz_core_seek(), rz_core_seek_analysis_bb(), rz_core_seek_and_save(), rz_core_seek_arch_bits(), rz_core_seek_base(), rz_core_seek_opcode_backward(), rz_core_seek_opt(), rz_core_shift_block(), rz_core_transform_op(), rz_core_types_link(), rz_core_types_link_print(), rz_core_types_link_show(), rz_core_visual_analysis(), rz_core_visual_analysis_refresh(), rz_core_visual_analysis_refresh_column(), rz_core_visual_cmd(), rz_core_visual_comments(), rz_core_visual_define(), rz_core_visual_hudclasses(), rz_core_visual_hudstuff(), rz_core_visual_mark_set(), rz_core_visual_offset(), rz_core_visual_prevopsz(), rz_core_visual_prompt_input(), rz_core_visual_seek_animation(), rz_core_visual_title(), rz_core_visual_trackflags(), rz_core_visual_view_rop(), rz_core_visual_xrefs(), rz_core_write_at(), rz_core_write_base64_at(), rz_core_write_base64d_at(), rz_core_write_block(), rz_core_write_block_op_at(), rz_core_write_duplicate_at(), rz_core_write_hexpair(), rz_core_write_length_string_at(), rz_core_write_random_at(), rz_core_write_seq_at(), rz_core_write_string_at(), rz_core_write_string_wide_at(), rz_core_write_string_zero_at(), rz_core_write_value_at(), rz_core_write_value_inc_at(), rz_core_yank(), rz_core_yank_file(), rz_core_yank_paste(), rz_core_yank_set(), rz_core_yank_set_str(), rz_core_yank_string(), rz_core_yank_to(), rz_debug_bochs_breakpoint(), rz_debug_bp_add(), rz_debug_continue_until(), rz_debug_continue_until_internal(), rz_debug_continue_until_nonblock(), rz_debug_desc_read(), rz_debug_desc_seek(), rz_debug_desc_write(), rz_debug_drx_at(), rz_debug_drx_set(), rz_debug_map_alloc(), rz_debug_map_dealloc(), rz_debug_map_get(), rz_debug_map_list_visual(), rz_debug_map_new(), rz_debug_map_protect(), rz_debug_memory_permission_handler(), rz_debug_session_add_mem_change(), rz_debug_snap_contains(), rz_debug_trace_add(), rz_debug_trace_get(), rz_debug_trace_ins_before(), rz_debug_trace_is_traceable(), rz_dyldcache_get_objc_opt_info(), rz_flag_zone_add(), rz_flag_zone_around(), rz_get_size(), rz_heap_chunk(), rz_heap_chunk_wrapper(), rz_heap_debug_block_win(), rz_il_event_mem_write_new(), rz_il_handler_load(), rz_il_handler_loadw(), rz_il_handler_store(), rz_il_handler_storew(), rz_il_vm_create_label(), rz_il_vm_update_label(), rz_io_cache_at(), rz_io_cache_read(), rz_io_cache_write(), rz_io_desc_read_at(), rz_io_desc_write_at(), rz_io_extend_at(), rz_io_fd_read_at(), rz_io_fd_seek(), rz_io_fd_write_at(), rz_io_map_add(), rz_io_map_add_batch(), rz_io_map_get(), rz_io_map_is_mapped(), rz_io_map_new(), rz_io_map_next_address(), rz_io_map_next_available(), rz_io_map_remap(), rz_io_map_remap_fd(), rz_io_map_resize(), rz_io_nread_at(), rz_io_plugin_read_at(), rz_io_plugin_write_at(), rz_io_read_at(), rz_io_read_at_mapped(), rz_io_read_i(), rz_io_write_at(), rz_io_write_i(), rz_itv_contain(), rz_itv_intersect(), rz_itv_new(), rz_itv_overlap2(), rz_lua_analysis_op(), rz_main_rizin(), rz_main_rz_bin(), rz_mem_count(), rz_meta_data_handler(), rz_meta_data_remove_handler(), rz_meta_del(), rz_meta_get_at(), rz_meta_get_in(), rz_meta_get_string(), rz_meta_set(), rz_meta_set_data_at(), rz_meta_set_string(), rz_meta_set_with_subtype(), rz_num_tail(), rz_num_tail_base(), rz_open_handler(), rz_open_maps_relocate_current_handler(), rz_open_maps_relocate_handler(), rz_open_nobin_handler(), rz_open_nobin_write_handler(), rz_open_write_handler(), RZ_PACKED(), rz_parse_filter(), rz_parse_filter_dup(), rz_print_addr(), rz_print_fill(), rz_print_hexdump_str(), rz_print_hexii(), rz_print_set_screenbounds(), rz_range_add_from_string(), rz_range_contains(), rz_range_get_data(), rz_range_item_get(), rz_range_set_data(), rz_regs_show_valgroup(), rz_reopen_debug_file_handler(), rz_run_start(), rz_search_find(), rz_search_hit_new(), rz_search_pattern(), rz_seek_asz_handler(), rz_seek_begin_handler(), rz_seek_end_handler(), rz_seek_function_handler(), rz_seek_handler(), rz_seek_offset(), rz_serialize_analysis_global_var_save(), rz_serialize_analysis_meta_save(), rz_serialize_analysis_switch_op_load(), rz_skyline_contains(), rz_skyline_get(), rz_skyline_get_intersect(), rz_skyline_get_item(), rz_skyline_get_item_intersect(), rz_str_range_in(), rz_type_format_10bytes(), rz_type_format_bitfield(), rz_type_format_data_internal(), rz_type_format_double(), rz_type_format_enum(), rz_type_format_float(), rz_type_format_hex(), rz_type_format_hexflag(), rz_type_format_int(), rz_type_format_nulltermstring(), rz_type_format_num(), rz_type_format_num_specifier(), rz_type_format_octal(), rz_type_format_string(), rz_type_format_time(), rz_type_format_word(), rz_type_link_del_handler(), rz_type_link_handler(), rz_type_link_show_handler(), rz_type_print_handler(), rz_type_xrefs_function_handler(), rz_write_extend_hexbytes_handler(), rz_write_extend_zero_handler(), rz_write_from_io_handler(), rz_yank_to_handler(), save_typelink(), search_similar_pattern_in(), sections(), sections_from_bin(), sections_from_mach0(), sections_print_json(), sections_print_table(), seek_check_save(), seek_save(), set_bin_relocs(), set_invalid_op(), set_jump_realname(), setup_new_instr(), sh_op(), shared_data_read_at(), shortest_path_successor_cb(), skip_hp(), snes_anop(), SOCKOPT_SETTER(), sparc_op(), sparse_write(), step_until(), str(), strex(), stringAt(), subvar(), symbols(), symbols_from_bin(), symbols_from_mach0(), symbols_from_stubs(), symbols_print(), tbb(), tms320_c55x_plus_op(), tms320_op(), trace_hook_mem_read(), trace_hook_mem_write(), try_loadlib(), type_format_print_variable(), type_match(), typelinks_load_sdb(), types_xrefs_function(), unset_addr_hint_record(), update_stat_for_op(), updateAddr(), uv__convert_to_localhost_if_unspecified(), uv__send(), uv__tcp_bind(), uv__tcp_connect(), uv__udp_bind(), uv__udp_check_before_send(), uv__udp_connect(), uv__udp_disconnect(), uv__udp_is_bound(), uv__udp_is_connected(), uv__udp_maybe_deferred_bind(), uv__udp_send(), uv__udp_try_send(), uv_getnameinfo(), uv_ip4_addr(), uv_ip6_addr(), uv_tcp_bind(), uv_tcp_connect(), uv_tcp_try_bind(), uv_tcp_try_connect(), uv_udp_bind(), uv_udp_connect(), uv_udp_maybe_bind(), uv_udp_send(), uv_udp_try_send(), uv_wsarecvfrom_workaround(), v810_op(), v850_op(), va2pa(), vaddr_to_paddr(), value_fill_addr_pc_disp(), var_accesses_list(), var_functions_show(), var_rename(), var_variables_show(), variable_rename(), variable_set_type(), visual_comma(), visual_seek_animation(), vle_snprint(), w32_map_alloc(), w32_map_dealloc(), w32_map_protect(), walkSymbols(), wasm_op(), winkd_bkpt(), winkd_query_mem(), write_image_section_header(), writeback(), xap_op(), xnu_dbg_modules(), xnu_map_alloc(), xnu_map_dealloc(), xnu_map_protect(), xrefs_graph(), xrefs_graph_fcn_start_json(), xtensa_accer_op(), xtensa_b_op(), xtensa_calln_op(), xtensa_fp0_op(), xtensa_fp1_op(), xtensa_imm12s(), xtensa_imm18s(), xtensa_imm6s(), xtensa_imm8s(), xtensa_imp_op(), xtensa_l32r_op(), xtensa_lsai_op(), xtensa_lsc4_op(), xtensa_lsci_op(), xtensa_lscx_op(), xtensa_offset(), xtensa_op(), xtensa_qrst_op(), xtensa_rfei_op(), xtensa_rst0_op(), xtensa_rst1_op(), xtensa_rst2_op(), xtensa_rt0_op(), xtensa_si_op(), xtensa_snm0_op(), xtensa_st0_op(), xtensa_st1_op(), xtensa_st2n_op(), xtensa_st3n_op(), xtensa_sync_op(), xtensa_tlb_op(), and z80_analysis_op().

◆ baseaddr

◆ bitsetres

const char * bitsetres
static

Definition at line 67 of file z80asm.c.

Referenced by rd_0_7().

◆ comma

◆ define_macro

int define_macro = 0
static

Definition at line 88 of file z80asm.c.

Referenced by assemble().

◆ file

◆ indexed

int indexed
static

◆ indexjmp

const char * indexjmp
static

Definition at line 67 of file z80asm.c.

Referenced by assemble(), rd_ld(), rd_lda(), rd_ldbcdehla(), rd_r(), rd_r_(), rd_r_add(), and rd_r_rr().

◆ mem_delimiter

char mem_delimiter
static

Definition at line 82 of file z80asm.c.

Referenced by indx(), rd_byte(), and rd_word().

◆ mnemonics

const char* mnemonics[]
static
Initial value:
= {
"call", "cpdr", "cpir", "djnz", "halt", "indr", "inir", "lddr", "ldir",
"otdr", "otir", "outd", "outi", "push", "reti", "retn", "rlca", "rrca",
"defb", "defw", "defs", "defm",
"adc", "add", "and", "bit", "ccf", "cpd", "cpi", "cpl", "daa", "dec", "equ",
"exx", "inc", "ind", "ini", "ldd", "ldi", "neg", "nop", "out", "pop",
"res", "ret", "rla", "rlc", "rld", "rra", "rrc", "rrd", "rst", "sbc",
"scf", "set", "sla", "sll", "sli", "sra", "srl", "sub", "xor", "org",
"cp", "di", "ei", "ex", "im", "in", "jp", "jr", "ld", "or", "rl", "rr",
"db", "dw", "ds", "dm",
"include", "incbin", "if", "else", "endif", "end", "macro", "endm",
"seek", NULL
}

Definition at line 43 of file z80asm.c.

Referenced by readcommand().

◆ obuf

◆ obuflen

int obuflen = 0
static

Definition at line 37 of file z80asm.c.

Referenced by assemble(), and file_vprintf().

◆ readbyte

const char* readbyte
static

Definition at line 64 of file z80asm.c.

Referenced by assemble(), rd_byte(), rd_ld_hl(), rd_lda(), rd_ldbcdehla(), rd_nnc(), rd_r(), and rd_r_add().

◆ readword

const char* readword
static

Definition at line 67 of file z80asm.c.

Referenced by assemble(), rd_ld(), rd_lda(), rd_nn_nn(), rd_sp(), and rd_word().

◆ sp

int sp
static

Definition at line 91 of file z80asm.c.

Referenced by __init_panel_param(), __io_maps(), __panels_check_stackbase(), analysis_emul_init(), anop_esil(), asciiart_backtrace(), assemble(), backref(), backtrace_fuzzy(), backtrace_generic(), backtrace_vars(), check_label(), compute_ref(), count_flags_in_space(), dissect(), do_rd_expr(), ds_print_calls_hints(), ds_print_esil_analysis(), enlarge(), extract_arg(), false_positive(), fill_insn(), find_e_opts(), FUZ_unitTests(), get_state_pkt_index(), get_word_from_canvas(), indx(), internal_esil_reg_write_no_null(), p_b_cclass(), p_b_coll_elem(), printerr(), rd_character(), rd_expr_and(), rd_expr_equal(), rd_expr_or(), rd_expr_shift(), rd_expr_unequal(), rd_expr_xor(), rd_factor(), rd_label(), rd_number(), rd_otherbasenumber(), rd_term(), rd_value(), readlabel(), rz_analysis_appcall_handler(), rz_analysis_fcn_format_sig(), rz_arm_cs_analysis_op_32_esil(), rz_asm_massemble(), rz_cmd_kuery(), rz_cmd_panels(), rz_cmd_search(), rz_core_analysis_bytes(), rz_core_arg_get(), rz_core_debug_plugins_print(), rz_core_get_func_args(), rz_core_link_stroff(), rz_core_print_disasm_all(), rz_core_visual_view_rop(), rz_debug_step_soft(), rz_flag_space_remove_handler(), RZ_PACKED(), rz_socket_proc_close(), rz_socket_proc_gets(), rz_socket_proc_open(), rz_socket_proc_printf(), rz_socket_proc_read(), rz_socket_proc_ready(), rz_socket_proc_write(), rz_spaces_add(), rz_spaces_count(), rz_spaces_current(), rz_spaces_current_name(), rz_spaces_fini(), rz_spaces_free(), rz_spaces_get(), rz_spaces_init(), rz_spaces_is_empty(), rz_spaces_new(), rz_spaces_pop(), rz_spaces_purge(), rz_spaces_push(), rz_spaces_rename(), rz_spaces_set(), rz_spaces_unset(), rz_sys_pid_to_path(), selection_widget_select(), set_access_info(), skipword(), spaces_unset_single(), tms320_tokenize(), type_pos_hit(), unset_flagspace(), update_stat_for_op(), uv_uptime(), and winkd_get_profile().

◆ stack

struct stack stack[MAX_INCLUDE]
static

Definition at line 91 of file z80asm.c.

Referenced by backtrace_fuzzy(), lunpipe(), and rz_core_get_stacksz().

◆ verbose

◆ writebyte

int writebyte
static

Definition at line 63 of file z80asm.c.

Referenced by assemble(), rd_byte(), rd_ld_hl(), rd_lda(), rd_ldbcdehla(), rd_r(), and rd_r_add().

◆ z80buffer

char* z80buffer = NULL
static

Definition at line 85 of file z80asm.c.

Referenced by assemble().