/* memory.c */

#ifndef memory_H
#define memory_H

void load_cache (void);
zbyte_t read_code_byte (void);
zbyte_t read_data_byte (unsigned *);
zword_t read_code_word (void);
zword_t read_data_word (unsigned *);

#define read_code_byte() (*pc++)
#define read_data_byte(a) datap[(*(a))++]

#define read_code_word() (pc+=2, (*(pc-2)<<8)|*(pc-1))
#define read_data_word(a) ((*(a))+=2, (datap[*(a)-2]<<8)|datap[*(a)-1])

#endif
